Commit 849f3c8a authored by Libin Lu's avatar Libin Lu Committed by GitHub

Update README.md

parent 04a3de85
...@@ -243,7 +243,7 @@ class App extends Component { ...@@ -243,7 +243,7 @@ class App extends Component {
otherMethods(){ otherMethods(){
FCM.subscribeToTopic('/topics/foo-bar'); FCM.subscribeToTopic('/topics/foo-bar');
FCM.unsubscribeFromTopic('/topics/foo-bar'); FCM.unsubscribeFromTopic('/topics/foo-bar');
FCM.getInitialNotification().then(...); FCM.getInitialNotification().then(notif=>console.log(notif));
FCM.presentLocalNotification({ FCM.presentLocalNotification({
id: "UNIQ_ID_STRING", // (optional for instant notification) id: "UNIQ_ID_STRING", // (optional for instant notification)
title: "My Notification Title", // as FCM payload title: "My Notification Title", // as FCM payload
...@@ -272,18 +272,18 @@ class App extends Component { ...@@ -272,18 +272,18 @@ class App extends Component {
body: "from future past", body: "from future past",
repeat_interval: "week" //day, hour repeat_interval: "week" //day, hour
}) })
FCM.getScheduledLocalNotifications().then(...); FCM.getScheduledLocalNotifications().then(notif=>console.log(notif));
FCM.cancelLocalNotification("UNIQ_ID_STRING"); FCM.cancelLocalNotification("UNIQ_ID_STRING");
FCM.cancelAllLocalNotifications(); FCM.cancelAllLocalNotifications();
FCM.setBadgeNumber(); FCM.setBadgeNumber();
FCM.getBadgeNumber().then(...); FCM.getBadgeNumber().then(number=>console.log(number));
} }
} }
``` ```
### Behaviour when sending `notification` and `data` payload through GCM ### 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) - When app is running in background (the tricky one, I strongly suggest you try it out yourself)
- IOS will receive notificaton from `FCMNotificationReceived` event - IOS will receive notificaton from `FCMNotificationReceived` event
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment