iOS example fails getting dispatcherKey and setting data. Also missing background update function on iOS
What happened?
Compiled the packages/home_widget/example/ios with failure because of missing Flutter package:
Swift Compiler Error (Xcode): Unable to find module dependency: 'Flutter'
Had to add the flutter package like this, to get it running: https://stackoverflow.com/questions/79785796/swift-compiler-error-xcode-unable-to-find-module-dependency-flutter
When running the example text is shown (but no send receive is detected by the widget).
Also getting an assert on: https://github.com/ABausG/home_widget/blob/28f8e8400fc9a46a7cbf58e143c9d005f0d4b52e/packages/home_widget/ios/Classes/HomeWidgetBackgroundWorker.swift#L40-L42
The dispatcher is never found
What do you expect?
Work as good as the Android version
Relevant log output
-- LLDB integration loaded --
`UIScene` lifecycle will soon be required. Failure to adopt will result in an assert in the future.
FlutterView implements focusItemsInRect: - caching for linear focus movement is limited as long as this view is on screen.
flutter: The Dart VM service is listening on http://127.0.0.1:58420/rVaxV4I3JJ0=/
home_widget/HomeWidgetBackgroundWorker.swift:41: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Execute in a terminal and put output into the code block below
Output of: flutter doctor -v [✓] Flutter (Channel stable, 3.38.3, on macOS 26.1 25B78 darwin-arm64, locale nb-NO) [942ms] • Flutter version 3.38.3 on channel stable at /Users/large/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 19074d12f7 (2 days ago), 2025-11-20 17:53:13 -0500 • Engine revision 13e658725d • Dart version 3.10.1 • DevTools version 2.51.1 • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1 237ms]
• Android SDK at /Users/large/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36, build-tools 36.1.0
• ANDROID_HOME = /Users/large/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.1.1) [801ms] • Xcode at /Applications/Xcode.app/Contents/Developer • Build 17B100 • CocoaPods version 1.16.2
[✓] Chrome - develop for the web [4ms] • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (4 available) [8,3s] • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 16 (API 36) (emulator) • iPhone 17 Pro Max (mobile) • 51184E6F-D2B7-44FE-B4B3-B7BD163069C7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-1 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 26.1 25B78 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.176
[✓] Network resources [708ms] • All expected network resources are available.
• No issues found!
On which Platform do you experience this issue?
iOS
Other information
I have adopted an early version of your home_widget and it works (most of the time). Now I am looking to update it, but is iOS falling behind?
Are you interested in working on a PR for this?
- [ ] I want to work on this