Commit fb9a3bf3 authored by Libin Lu's avatar Libin Lu

crash fix

parent 3074ae43
...@@ -22,6 +22,7 @@ FCM.requestPermissions = () => { ...@@ -22,6 +22,7 @@ FCM.requestPermissions = () => {
}; };
FCM.presentLocalNotification = (details) => { FCM.presentLocalNotification = (details) => {
details.id = details.id || new Date().getTime().toString()
details.local_notification = true; details.local_notification = true;
RNFIRMessaging.presentLocalNotification(details); RNFIRMessaging.presentLocalNotification(details);
}; };
...@@ -71,7 +72,7 @@ FCM.getBadgeNumber = () => { ...@@ -71,7 +72,7 @@ FCM.getBadgeNumber = () => {
FCM.on = (event, callback) => { FCM.on = (event, callback) => {
const nativeEvent = eventsMap[event]; const nativeEvent = eventsMap[event];
if (!nativeEvent) { if (!nativeEvent) {
throw new Error('FCM invalid event'); throw new Error('FCM event must be "refreshToken" or "notification"');
} }
const listener = DeviceEventEmitter.addListener(nativeEvent, callback); const listener = DeviceEventEmitter.addListener(nativeEvent, callback);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment