diff --git a/Examples/simple-fcm-client/app/App.js b/Examples/simple-fcm-client/app/App.js index 48554b7b6546460ece923e6f032df96216a3007f..cff58090e75ce066ad191a4d8e3cfdbdbc07dd57 100644 --- a/Examples/simple-fcm-client/app/App.js +++ b/Examples/simple-fcm-client/app/App.js @@ -10,7 +10,8 @@ import { Text, TouchableOpacity, View, - Clipboard + Clipboard, + Platform } from 'react-native'; import FCM from "react-native-fcm"; @@ -157,15 +158,15 @@ export default class App extends Component { Remote notif won't be available to iOS emulators - firebaseClient.sendRemoteNotification(token)} style={styles.button}> + this.sendRemoteNotification(token)} style={styles.button}> Send Remote Notification - firebaseClient.sendRemoteData(token)} style={styles.button}> + this.sendRemoteData(token)} style={styles.button}> Send Remote Data - firebaseClient.sendRemoteNotificationWithData(token)} style={styles.button}> + this.sendRemoteNotificationWithData(token)} style={styles.button}> Send Remote Notification With Data diff --git a/Examples/simple-fcm-client/app/FirebaseClient.js b/Examples/simple-fcm-client/app/FirebaseClient.js index 18c27715fbdd1c268b2db07293dfae38f7496322..7f96e2e410b3b8fa334bc4651f6e8e46d037f4ed 100644 --- a/Examples/simple-fcm-client/app/FirebaseClient.js +++ b/Examples/simple-fcm-client/app/FirebaseClient.js @@ -1,16 +1,10 @@ import FirebaseConstants from "./FirebaseConstants"; -import { Platform, Alert } from "react-native"; +import { Alert } from "react-native"; const API_URL = "https://fcm.googleapis.com/fcm/send"; class FirebaseClient { - constructor() { - this.sendData = this.sendData.bind(this); - this.sendNotification = this.sendNotification.bind(this); - this.sendNotificationWithData = this.sendNotificationWithData.bind(this); - } - async send(body, type) { if(FirebaseClient.KEY === 'YOUR_API_KEY'){ Alert.alert('Set your API_KEY in app/FirebaseConstants.js')