Commit 1ab567cf authored by Libin Lu's avatar Libin Lu

update example

parent 41091ebb
...@@ -12,30 +12,33 @@ class FirebaseClient { ...@@ -12,30 +12,33 @@ class FirebaseClient {
} }
sendNotification(token) { sendNotification(token) {
let body = { let body;
"to": token,
"notification":{
"title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.",
"sound": "default"
},
"priority": 10
}
if(Platform.OS === 'android'){ if(Platform.OS === 'android'){
body = { body = {
"to": token, "to": token,
"data":{ "data":{
"custom_notification": { "custom_notification": {
"title": "Simple FCM Client", "title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.", "body": "This is a notification with only NOTIFICATION.",
"sound": "default", "sound": "default",
"priority": "high" "priority": "high",
} "show_in_foreground": true
}, }
"priority": 10 },
"priority": 10
} }
} } else {
body = {
"to": token,
"notification":{
"title": "Simple FCM Client",
"body": "This is a notification with only NOTIFICATION.",
"sound": "default"
},
"priority": 10
}
}
this._send(JSON.stringify(body), "notification"); this._send(JSON.stringify(body), "notification");
} }
......
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