diff --git a/Examples/simple-fcm-client/app/FirebaseClient.js b/Examples/simple-fcm-client/app/FirebaseClient.js index 2c583b381773c9cfca4be5c02d0fa304c7f5c339..b8a85686d3319d2382805dd6785df3a03f9455d0 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"); }