-
-
Notifications
You must be signed in to change notification settings - Fork 268
Description
What happened?
`@pragma('vm:entry-point')
Future myBackgroundMessageHandler(RemoteMessage message) async {
await Firebase.initializeApp();
await SharePreferenceManager.initSharePreference();
// initial ref
try {
if (message.data["notification_type"] == "1") {
final widgetHelper = _BackgroundWidgetHelper();
print('🎯 Background _BackgroundWidgetHelper ok');
await HomeWidget.saveWidgetData("title", message.notification?.title);
HomeWidget.updateWidget(...)
}
} catch (e) {
print('🎯 Background handler error: $e');
}
}`
1, Android Background mode => When receive notification in background => I have config using HomeWidget.saveWidgetData, HomeWidget.updateWidget
But: MissingPluginException(No implementation found for method saveWidgetData on channel home_widget)
What do you expect?
how to using func HomeWidget.saveWidgetData or HomeWidget.updateWidget, ... when background mode Android
Relevant log output
Execute in a terminal and put output into the code block below
Output of: flutter doctor -v
[✓] Flutter (Channel stable, 3.22.3, on macOS 15.5 24F74 darwin-arm64, locale en-VN)
• Flutter version 3.22.3 on channel stable at /xxx/3.22.3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b0850beeb2 (12 months ago), 2024-07-16 21:43:41 -0700
• Engine revision 235db911ba
• Dart version 3.4.4
• DevTools version 2.34.3
On which Platform do you experience this issue?
Android
Other information
No response
Are you interested in working on a PR for this?
- I want to work on this