@@ -20,7 +20,7 @@ In order to work correctly there needs to be some platform specific setup. Check
20
20
<details ><summary >iOS</summary >
21
21
22
22
### Add a Widget to your App in Xcode
23
- Add a widget extension by going ` File > New > Target > Widget Extension `
23
+ Add a widget extension by going < kbd > File</ kbd > > < kbd > New</ kbd > > < kbd > Target</ kbd > > < kbd > Widget Extension</ kbd >
24
24
25
25
![ Widget Extension] ( https://github.com/ABausG/home_widget/blob/main/.github/assets/widget_extension.png?raw=true )
26
26
@@ -30,19 +30,18 @@ You need to add a groupId to the App and the Widget Extension
30
30
31
31
** Note: in order to add groupIds you need a paid Apple Developer Account**
32
32
33
- Go to your [ Apple Developer Account] ( https://developer.apple.com/account/resources/identifiers/list/applicationGroup ) and add a new group
34
- Add this group to you Runner and the Widget Extension inside XCode ` Signing & Capabilities > App Groups > + `
33
+ Go to your [ Apple Developer Account] ( https://developer.apple.com/account/resources/identifiers/list/applicationGroup ) and add a new group.
34
+ Add this group to your Runner and the Widget Extension inside XCode: <kbd >Signing & Capabilities</kbd > > <kbd >App Groups</kbd > > <kbd >+</kbd >.
35
+ (To swap between your App, and the Extension change the Target)
35
36
36
37
![ Build Targets] ( https://github.com/ABausG/home_widget/blob/main/.github/assets/target.png?raw=true )
37
38
38
- (To swap between your App, and the Extension change the Target)
39
-
40
39
### Sync CFBundleVersion (optional)
41
40
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.
42
41
43
42
![ Build Phases] ( https://github.com/ABausG/home_widget/blob/main/.github/assets/build_phases.png?raw=true )
44
43
45
- In your Runner (app) target go to ` Build Phases > + > New Run Script Phase ` and add the following script:
44
+ In your Runner (app) target go to < kbd > Build Phases</ kbd > > < kbd >+</ kbd > > < kbd > New Run Script Phase</ kbd > and add the following script:
46
45
``` bash
47
46
generatedPath=" $SRCROOT /Flutter/Generated.xcconfig"
48
47
versionNumber=$( grep FLUTTER_BUILD_NAME $generatedPath | cut -d ' =' -f2)
@@ -126,8 +125,10 @@ HomeWidgetPlugin.getData(context)
126
125
127
126
### Setup
128
127
<details ><summary >iOS</summary >
128
+
129
129
For iOS, you need to call ` HomeWidget.setAppGroupId('YOUR_GROUP_ID'); `
130
130
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
131
+
131
132
</details >
132
133
133
134
### Save Data
@@ -231,13 +232,13 @@ Android and iOS (starting with iOS 17) allow widgets to have interactive Element
231
232
<details><summary>iOS</summary>
232
233
233
234
1. Adjust your Podfile to add `home_widget` as a dependency to your WidgetExtension
234
- ```
235
+ ```rb
235
236
target 'YourWidgetExtension' do
236
237
use_frameworks!
237
238
use_modular_headers!
238
239
239
240
pod 'home_widget', :path => '.symlinks/plugins/home_widget/ios'
240
- end
241
+ end
241
242
```
242
243
2 . To be able to use plugins with the Background Callback add this to your AppDelegate's ` application ` function
243
244
``` swift
0 commit comments