Is there a proper way/flutter-firebase guidelines to prevent a flutter app to re-start from main.dart when loading from onLaunch() of FCM firebase notification .
I can see ,onLaunch being triggered but soon main.dart overrides it .
_fcm.configure(
// Called when the app is in the foreground and we receive a push notification
onMessage: (Map<String, dynamic> message) async {
print('onMessage: $message');
},
// Called when the app has been closed comlpetely and it's opened
// from the push notification.
onLaunch: (Map<String, dynamic> message) async {
print('onLaunch: $message');
_serialiseAndNavigate(message); //THIS WORKS , BUT SUDDENLY main.dart KICKS IN .
},
// Called when the app is in the background and it's opened
// from the push notification.
onResume: (Map<String, dynamic> message) async {
print('onResume: $message');
_serialiseAndNavigate(message);
},
);