React Native app reloads clicking on push notification - react-native

I am using react-native-notifications. I am getting push notifications perfectly but the issue is when the app is in the foreground and received push notifications. I clicked on the notification, the app reloads instead of resuming and the app is in the foreground all this time. It happens for every single push notification.
The event handler on click of push notification is being called and app reloads. I am just doing console in the handler.
Notifications.events().registerNotificationOpened()
Tried singleTop, singleTask, or singleInstance in manifest file. no luck

Related

React Native - Get initial route when App is opened from a notification

I'm using react-native and onesignal to handle notification.
If you press the notification when the app is in the background, i'll catch the 'opened' event, and redirect to the correct route (in the notification metadata)
But when the app is closed, the click on the notification just opens the app, without firing the 'opened' event.
How can i fetch the initial pressed notification metadata ?
Thanks
If you are using RNFirebase Cloud Messaging, you can use the proper listener getInitialNotification where you can catch when the notification is opened while the app is closed. Follow that guide Notifications - Handling Interaction for more infos.

How can i display sendbird push notification when appllication is in foregroundmode?

I've implemented sendbird push notification in react-native. It's working fine when application is in background mode. but if application is in foreground mode then it's not display.
In code, I have also set sb.setForegroundState() and sb.setBackgroundState() method with application state.
So, anyone help me for solve out this ?
SendBird sends a push notification only when a user is disconnected. So, if the application is foreground and a user is connected, the app will not receive a push notification.
If you want to show a push notification when your application is in the foreground, you can show it using data in onMessageReceived() or onChannelChanged().
you can select "Send to devices both offline and online" from sendbird dashboard to receive notifications when the app is in the foreground
Sendbird -> Settings -> Notification -> Push notifications for multi-device users -> select "Send to devices both offline and online"

Withdraw/delete push notification in React Native

Our React Native app needs to send out push notification to a number of people (iOS and Android, app can be open, backgrounded, or closed), and when just one of these people performs a specific in-app action, we need our server to erase these push notifications from everyone's phones (again from either open, backgrounded, or closed). Is this possible to do for both iOS and Android?
You can send background notification (data notification if firebase) and implement frontend listeners to cancel all notifications received so far.

Not able to get notification in bar when app is opened

I have implemented push notification using gcm in my ionic 2 app, the notification works fine in background and foreground, but the issue is that when app is in foreground the notification doesn't appear in notification bar. Please help
You may refer with this forum:Ionic 2, Android notification received but banner not showing on device.
It stated that if the app is in the foreground, the notification is not shown in the system tray. That only happens when the notification is received while the app is in the background.
Additional references:
GCM notification doesn't show up in the notification bar. Android
push notification doesn't show up on status bar
Android - GCM push notifications not appearing in notifications list

WL push notification callback not being invoked in iOS when app is in background

We have push notifications working successfully. Backend event source is a Worklight adapter written in JS using the 'WL.Server.createDefaultNotification' and 'WL.Server.notifyAllDevices' API calls to send unicast notifications. In the front-end, the app is registered for push notification call back using 'WL.Client.Push.registerEventSourceCallback' JS API.
These particular scenarios are not working:
App is open in the background after login. Notification message is received, but user does not tap notification banner message - and instead just opens app by touching app icon. Notification callback method is not called - and subsequently payload from the backend is not available for the method.
App is open in the background after login. Notification message is received which only has iOS badge change and payload but no notification message for the banner or lock screen. In which case user has nothing to tap on. When user opens the app again - notification callback is not called.
Knowledgecenter documentation seems to indicate that the callback method should be getting invoked even if the app is running in the background. This is with Worklight 6.2.0.1.
Push is indeed supposed to work as you've describe. This is a bug.
This is no manual workaround for this.
If you are an IBM customer or Business Partner you will need to open a PMR (support ticket).