onNotification is getting triggered as soon as notification is received in IOS
See original GitHub issueBug
onNotification
Event handler is getting fired as soon an notification is received on IOS.
Also, when user click on the notification, onNotification
getting triggered but the data object doesn’t have value.
But in android its working fine, when notification is recived, it doesnt get triggered. When user click on it, then only the onNotification
is getting triggered and it also contain all the data.
Environment info
Library version: 8.1.1
Reproducible sample code
PushNotification.configure({
onNotification: function (notification) {
if (!notification?.data) {
return;
}
console.log('[ON OPEN NOTIFICATION]', notification);
onOpenNotification(Platform.OS === 'ios' ? notification.data : notification.data.data);
if (Platform.OS === 'ios') {
notification.finish(PushNotificationIOS.FetchResult.NoData);
}
},
});
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top Results From Across the Web
How to trigger "onNotification" function on received notification?
my "onNotification" function is not triggered when getting remote notification. I have used the same flow explained inside example app.
Read more >How to trigger "onNotification" function on received notification?
Typically occurs when APNS is having issues, or the device is a simulator. (iOS) onRegistrationError(err) { console.log(err); } attachRegister( ...
Read more >react-native-community/push-notification-ios Code Examples
onNotification (notificationObj) } }) // Get notifications that were triggered when the app was backgrounded PushNotificationIOS.
Read more >Ionic3.9 onNotification not triggered when app is in foreground ...
... state and but in IOS onNotification doesn't trigger when the app is in ... But I was able to get the notification...
Read more >SDK Notification Event Handlers - OneSignal Documentation
Force-quit Notification Received Event, iOS - Force-quit state is when the app has been "swiped away" and not running in the foreground or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And https://github.com/zo0r/react-native-push-notification#state-of-the-repository
You can take a look at https://github.com/zo0r/react-native-push-notification/blob/master/trouble-shooting.md