evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

Receive notification data when I click the notification when the application is not running #1056

Open cetinahmetemre opened 5 years ago

cetinahmetemre commented 5 years ago

When my application run on background or foreground , if i click the notification , I can take to notification datas. But, If I click the notification When application doesn't run , I can take notifacation datas. How can i take datas when my application doesn't run.

This function works when notification is received while the application is running , but if application is not running , this function not running

FCM.on(FCMEvent.Notification, notif => {

        console.log("Notification is received", notif);   

    });
bastolaxantos commented 5 years ago

Try this: FCM.getInitialNotification().then(notif => { console.log(notif); });