You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
if (!hasBeenInitializedFireBase) {
awaitFirebase.initializeApp(options:DefaultFirebaseOptions.currentPlatform);
hasBeenInitializedFireBase =true;
}
awaitsetupFlutterNotifications();
showFlutterNotification(message);
}
showFlutterNotification(RemoteMessage message) {
// How to get context here to localize string like a S.of(context).noData
}
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Please help me. How to get context to localize notification in Application, if app - terminated
I try "GlobalKey" but navigatorKey.currentContext - always null;
Beta Was this translation helpful? Give feedback.
All reactions