From 90d0265c5561704af2dfccc5a43d2c5bbd743873 Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Thu, 9 Nov 2017 11:23:55 -0500 Subject: [PATCH] fix example --- Examples/simple-fcm-client/app/App.js | 9 +++++---- Examples/simple-fcm-client/app/FirebaseClient.js | 8 +------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Examples/simple-fcm-client/app/App.js b/Examples/simple-fcm-client/app/App.js index 48554b7..cff5809 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 18c2771..7f96e2e 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') -- 2.26.2