From 9e32abba7285d957f3ecf776d804da3033096e2b Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Mon, 16 Apr 2018 00:20:50 -0400 Subject: [PATCH] update data --- Examples/firebase-migration/app/App.js | 6 ++---- Examples/firebase-migration/app/Listeners.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Examples/firebase-migration/app/App.js b/Examples/firebase-migration/app/App.js index 74b70d5..04bbd94 100644 --- a/Examples/firebase-migration/app/App.js +++ b/Examples/firebase-migration/app/App.js @@ -98,8 +98,7 @@ class MainPage extends Component { .setBody("Force touch to reply") .setSound("bell.mp3") .setData({ - key1: 'value1', - key2: 'value2' + now: new Date().toISOString() }); notification.ios.badge = 10 notification.android.setAutoCancel(true); @@ -125,8 +124,7 @@ class MainPage extends Component { .setBody("Force touch to reply") .setSound("bell.mp3") .setData({ - key1: 'value1', - key2: 'value2' + now: new Date().toISOString() }); notification.android.setChannelId("test-channel") notification.android.setPriority(firebase.notifications.Android.Priority.High) diff --git a/Examples/firebase-migration/app/Listeners.js b/Examples/firebase-migration/app/Listeners.js index c13f8f3..d03e2fb 100644 --- a/Examples/firebase-migration/app/Listeners.js +++ b/Examples/firebase-migration/app/Listeners.js @@ -15,8 +15,8 @@ function displayNotificationFromCustomData(message: RemoteMessage){ } } -export function registerKilledListener(message: RemoteMessage){ - AsyncStorage.setItem('lastNotification', JSON.stringify(message.data)); +export async function registerKilledListener(message: RemoteMessage){ + await AsyncStorage.setItem('lastNotification', JSON.stringify(message.data)); displayNotificationFromCustomData(); } -- 2.26.2