void main() async {
WidgetsFlutterBinding.ensureInitialized();
await GetStorage.init();
await Firebase.initializeApp();
await PushNotificationsService().init();
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
runApp(MyApp());
setuplocator();
}
Above code is set on main thread. Now the problems is that app not received notification when it is on background. on foreground it works fine. But it is not working in background.
But this all is happening in debug mode and not in release mode. What to do ?