Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Improve README Formatting #204

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ In order to work correctly there needs to be some platform specific setup. Check
<details><summary>iOS</summary>

### 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 <kbd>File</kbd> > <kbd>New</kbd> > <kbd>Target</kbd> > <kbd>Widget Extension</kbd>

![Widget Extension](https://github.com/ABausG/home_widget/blob/main/.github/assets/widget_extension.png?raw=true)

Expand All @@ -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: <kbd>Signing & Capabilities</kbd> > <kbd>App Groups</kbd> > <kbd>+</kbd>.
(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 <kbd>Build Phases</kbd> > <kbd>+</kbd> > <kbd>New Run Script Phase</kbd> and add the following script:
```bash
generatedPath="$SRCROOT/Flutter/Generated.xcconfig"
versionNumber=$(grep FLUTTER_BUILD_NAME $generatedPath | cut -d '=' -f2)
Expand Down Expand Up @@ -110,8 +109,10 @@ For more Information on how to create and configure Android Widgets, check out [

### Setup
<details><summary>iOS</summary>

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

</details>

### Save Data
Expand Down Expand Up @@ -163,13 +164,13 @@ Android and iOS (starting with iOS 17) allow widgets to have interactive Element
<details><summary>iOS</summary>

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
Expand Down Expand Up @@ -453,4 +454,4 @@ to [AppDelegate.swift](example/ios/Runner/AppDelegate.swift)
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)
- [iOS Lockscreen Widgets with Flutter and home_widget](https://medium.com/p/0dfecc18cfa0)
Loading