Commit 94ec53e9 authored by Sean Adkinson's avatar Sean Adkinson

Added note to readme

parent 2ce31597
...@@ -425,6 +425,26 @@ Example of payload that is sent to FCM server: ...@@ -425,6 +425,26 @@ Example of payload that is sent to FCM server:
Check local notification guide below for configuration. Check local notification guide below for configuration.
**IMPORTANT**: When using the `admin.messaging` API, you need to `JSON.stringify` the `custom_notification` value:
```
let tokens = [...];
let payload = {
data: {
custom_notification: JSON.stringify({
body: 'Message body',
title: 'Message title'
...
})
}
};
let options = { priority: "high" };
admin
.messaging()
.sendToDevice(tokens, payload, options);
```
### Behaviour when sending `notification` and `data` payload through GCM ### Behaviour when sending `notification` and `data` payload through GCM
- When user clicks notification to **launch** the application, you can get that notification by calling `FCM.getInitialNotification`. (NOTE: reloading javascript or resuming from background won't change the value) - When user clicks notification to **launch** the application, you can get that notification by calling `FCM.getInitialNotification`. (NOTE: reloading javascript or resuming from background won't change the value)
......
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