From 8a3d12405718f87034aac2e71a891cb6abd52dbc Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Thu, 7 Sep 2017 09:49:32 -0400 Subject: [PATCH] Update FirebaseClient.js --- Examples/simple-fcm-client/app/FirebaseClient.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Examples/simple-fcm-client/app/FirebaseClient.js b/Examples/simple-fcm-client/app/FirebaseClient.js index 2c583b3..b8a8568 100644 --- a/Examples/simple-fcm-client/app/FirebaseClient.js +++ b/Examples/simple-fcm-client/app/FirebaseClient.js @@ -1,4 +1,5 @@ import FirebaseConstants from "./FirebaseConstants"; +import { Platform } from "react-native"; const API_URL = "https://fcm.googleapis.com/fcm/send"; @@ -21,6 +22,21 @@ class FirebaseClient { }, "priority": 10 } + + if(Platform.OS === 'android'){ + body = { + "to": token, + "data":{ + "custom_notification": { + "title": "Simple FCM Client", + "body": "This is a notification with only NOTIFICATION.", + "sound": "default", + "click_action": "fcm.ACTION.HELLO" + } + }, + "priority": 10 + } + } this._send(JSON.stringify(body), "notification"); } -- 2.26.2