diff --git a/index.js b/index.js index 34ca3758b363d0f03e1f908b30edfe4e4366d3e1..6a2711c5b821b97ce64a92ab4db13b36c0b23813 100644 --- a/index.js +++ b/index.js @@ -22,6 +22,7 @@ FCM.requestPermissions = () => { }; FCM.presentLocalNotification = (details) => { + details.id = details.id || new Date().getTime().toString() details.local_notification = true; RNFIRMessaging.presentLocalNotification(details); }; @@ -71,7 +72,7 @@ FCM.getBadgeNumber = () => { FCM.on = (event, callback) => { const nativeEvent = eventsMap[event]; if (!nativeEvent) { - throw new Error('FCM invalid event'); + throw new Error('FCM event must be "refreshToken" or "notification"'); } const listener = DeviceEventEmitter.addListener(nativeEvent, callback);