I have a use-case to execute some action upon receiving a notification only in the killed state in Flutter app.
In background as well as killed(i.e. terminated) state of app the notification control comes in Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message)
function. What I need is to determine whether the app is currently in background or killed. Upon that I need to perform some action.
Like:–
Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
if(isAppKilled()){
doKilledAction(message);
}
}
How do I implement isAppKilled()
?