From 849f3c8a5a7e6323e980b0299fd6d9628bc4b346 Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Mon, 26 Sep 2016 09:42:41 -0400 Subject: [PATCH] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3b9d2e8..2379012 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ class App extends Component { otherMethods(){ FCM.subscribeToTopic('/topics/foo-bar'); FCM.unsubscribeFromTopic('/topics/foo-bar'); - FCM.getInitialNotification().then(...); + FCM.getInitialNotification().then(notif=>console.log(notif)); FCM.presentLocalNotification({ id: "UNIQ_ID_STRING", // (optional for instant notification) title: "My Notification Title", // as FCM payload @@ -272,18 +272,18 @@ class App extends Component { body: "from future past", repeat_interval: "week" //day, hour }) - - FCM.getScheduledLocalNotifications().then(...); + + FCM.getScheduledLocalNotifications().then(notif=>console.log(notif)); FCM.cancelLocalNotification("UNIQ_ID_STRING"); FCM.cancelAllLocalNotifications(); FCM.setBadgeNumber(); - FCM.getBadgeNumber().then(...); + FCM.getBadgeNumber().then(number=>console.log(number)); } } ``` ### Behaviour when sending `notification` and `data` payload through GCM -- When app is not running and user clicks notification, notification data will be passed into `FCM.initialData` +- When app is not running and user clicks notification, notification data will be passed into `FCM.getInitialNotification` event - When app is running in background (the tricky one, I strongly suggest you try it out yourself) - IOS will receive notificaton from `FCMNotificationReceived` event -- 2.26.2