Closed AbdullahGaber closed 3 years ago
when app is terminated there is no event is fired instead you can get the notification opened the app
await FCMConfig.instance.getInitialMessage();
when app is terminated there is no event is fired instead you can get the notification opened the app
await FCMConfig.instance.getInitialMessage();
Thanks for your reply I try it but still same
i think you has to try it in release mode as you can not debug the terminated app try to get the message in your main function after init fcm
void main() async{
await await FCMConfig.instance.init();
/// there is no need for the next line,package call it for you
/// await Firebase.initializeApp();
var notification=await FCMConfig.instance.getInitialMessage();
/// you may get here the screen you want to open and path it to MyApp as at this point no navigation
runApp(
Phoenix(
child: MyApp(
screen: /// your first screen
),
),
);
}
i think you has to try it in release mode as you can not debug the terminated app try to get the message in your main function after init fcm
void main() async{ await await FCMConfig.instance.init(); /// there is no need for the next line,package call it for you /// await Firebase.initializeApp(); var notification=await FCMConfig.instance.getInitialMessage(); /// you may get here the screen you want to open and path it to MyApp as at this point no navigation runApp( Phoenix( child: MyApp( screen: /// your first screen ), ), ); }
thank you brother , you saved my life
``hello brother , when i click on notification while app is in background i can open a particular screen but while app is terminated i can't open particular Screen this is my code in main.dart file
my AndroidManifest.xml
thanks brother