From 5ee129336c8859c3a5865a30d64cabb235947819 Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Thu, 9 Jun 2016 09:37:16 -0400 Subject: [PATCH] fix readme for get token callback --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44cbf4f..7f6d739 100644 --- a/README.md +++ b/README.md @@ -119,13 +119,15 @@ var FCM = require('react-native-fcm'); componentWillMount() { FCM.requestPermissions(); -FCM.getFCMToken().then(token => { +FCM.getFCMToken().then(data => { + console.log(data.token) //store fcm token in your server }); this.fcmNotifLsnr = DeviceEventEmitter.addListener('FCMNotificationReceived', (notif) => { //there are two parts of notif. notif.notification contains the notification payload, notif.data contains data payload }); -this.fcmTokenLsnr = DeviceEventEmitter.addListener('FCMTokenRefreshed', (token) => { +this.fcmTokenLsnr = DeviceEventEmitter.addListener('FCMTokenRefreshed', (data) => { + console.log(data.token) //fcm token may not be available on first load, catch it here }); } -- 2.26.2