Currently, my app gets all the push notifications when in the background and terminated state (currently implementing local notification). When I send custom data in the Firebase console, all the data is correctly passed to the app when it is run foreground and background. However, when the app is terminated, the push message comes but the data is not retrieved successfully(only null data).
Is there any way to solve this? I don't understand why the push comes but then data does not. It would be really nice if you help out!
CodePudding user response:
For FCM push you will get data when app was in killed stae and push notification come and user tap on notification then you will get data in launcher screen.
CodePudding user response:
If you app startup from FCM message click when your app terminated, you need to custom this
FirebaseMessaging.instance.getInitialMessage().then((message) { //do something })