-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Description
When the application is opened from tapping a push notification the 'remoteNotificationReceived' event is fired multiple times for the same notification.
Example:
- Open app by pressing push notification in app tray
- Remote notification event fires with payload of push notification sent when app closed
- Send another notification with app open
- Remote notification event fires with payload of notification sent when app open
- Put the app in background then foreground
- Remote notification event fires again with payload corresponding to push notification sent when the app was closed.
- Whenever app is brought active from background the notification event fires again with the payload corresponding to the push notification sent when app was closed. This behavior continues until the app is restarted.
When adding the event listener I am using the following to ensure the event listener has not been added multiple times:
const onReceivedListeners = PushNotificationEmitter.listeners(DEVICE_NOTIF_EVENT);
if (onReceivedListeners.length === 0) {
PushNotificationEmitter.addListener(DEVICE_NOTIF_EVENT, pushNotificationRecevied);
}
The app is using the "singleTop" android launch mode.