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 {
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
......@@ -273,17 +273,17 @@ class App extends Component {
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
......
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