diff --git a/README.md b/README.md index d407f750..07845e9b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ In order to work correctly there needs to be some platform specific setup. Check
iOS ### Add a Widget to your App in Xcode -Add a widget extension by going `File > New > Target > Widget Extension` +Add a widget extension by going File > New > Target > Widget Extension ![Widget Extension](https://github.com/ABausG/home_widget/blob/main/.github/assets/widget_extension.png?raw=true) @@ -30,19 +30,18 @@ You need to add a groupId to the App and the Widget Extension **Note: in order to add groupIds you need a paid Apple Developer Account** -Go to your [Apple Developer Account](https://developer.apple.com/account/resources/identifiers/list/applicationGroup) and add a new group -Add this group to you Runner and the Widget Extension inside XCode `Signing & Capabilities > App Groups > +` +Go to your [Apple Developer Account](https://developer.apple.com/account/resources/identifiers/list/applicationGroup) and add a new group. +Add this group to your Runner and the Widget Extension inside XCode: Signing & Capabilities > App Groups > +. +(To swap between your App, and the Extension change the Target) ![Build Targets](https://github.com/ABausG/home_widget/blob/main/.github/assets/target.png?raw=true) -(To swap between your App, and the Extension change the Target) - ### Sync CFBundleVersion (optional) This step is optional, this will sync the widget extension build version with your app version, so you don't get warnings of mismatch version from App Store Connect when uploading your app. ![Build Phases](https://github.com/ABausG/home_widget/blob/main/.github/assets/build_phases.png?raw=true) -In your Runner (app) target go to `Build Phases > + > New Run Script Phase` and add the following script: +In your Runner (app) target go to Build Phases > + > New Run Script Phase and add the following script: ```bash generatedPath="$SRCROOT/Flutter/Generated.xcconfig" versionNumber=$(grep FLUTTER_BUILD_NAME $generatedPath | cut -d '=' -f2) @@ -126,8 +125,10 @@ HomeWidgetPlugin.getData(context) ### Setup
iOS + For iOS, you need to call `HomeWidget.setAppGroupId('YOUR_GROUP_ID');` Without this you won't be able to share data between your App and the Widget and calls to `saveWidgetData` and `getWidgetData` will return an error +
### Save Data @@ -231,13 +232,13 @@ Android and iOS (starting with iOS 17) allow widgets to have interactive Element
iOS 1. Adjust your Podfile to add `home_widget` as a dependency to your WidgetExtension - ``` + ```rb target 'YourWidgetExtension' do use_frameworks! use_modular_headers! pod 'home_widget', :path => '.symlinks/plugins/home_widget/ios' -end + end ``` 2. To be able to use plugins with the Background Callback add this to your AppDelegate's `application` function ```swift @@ -575,4 +576,4 @@ HomeWidget.isRequestPinWidgetSupported(); Please add to this list if you have interesting and helpful resources - [Google Codelab](https://codelabs.developers.google.com/flutter-home-screen-widgets#0) - [Interactive HomeScreen Widgets with Flutter using home_widget](https://medium.com/p/83cb0706a417) -- [iOS Lockscreen Widgets with Flutter and home_widget](https://medium.com/p/0dfecc18cfa0) \ No newline at end of file +- [iOS Lockscreen Widgets with Flutter and home_widget](https://medium.com/p/0dfecc18cfa0)