react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

onNotification callback handler not getting called in iOS for remote notifications

Open nairabhijit opened this issue 7 years ago • 8 comments

This happens when the application is in a killed state and I receive a notification and if i click on it, the onNotification callback handler is never called. This works when the application is in active state. I tried everything and gone through all issues similar to this posted by people on github but without any progress, also I rechecked notification configuration in Xcode. Any help would be appreciated.

nairabhijit avatar Jun 21 '19 16:06 nairabhijit

@nairabhijit is onNotification called after you tap on the notification?

matt-wright86 avatar Jun 21 '19 18:06 matt-wright86

No it doesn't and this is what the issue is.

nairabhijit avatar Jun 22 '19 06:06 nairabhijit

Have you enabled push notification capability in xcode?

maamounapprise avatar Jun 27 '19 16:06 maamounapprise

Do you get this message, when you click on Notifications a few times? Multiple notification open events received before the JS notifications module has been initialized. Then this might be related to #1026

markus-utke avatar Jun 27 '19 17:06 markus-utke

I resolved the issue by following this link. I had to do a lot of code rewrites, I had to replace library wix react-native-navigation with react-navigation, as I wasn't knowing how to set the appProperties to rootView in AppDelegate.m file with react-native-navigation. Also I figured out later that on release environment I am able to get the notification in PushNotiifcation.getInitialNotification() but not with debug environment. The behaviour is very inconsistent. Nevertheless now I am able to get the notification in debug as well as release environment when the application is in killed state.

nairabhijit avatar Jun 30 '19 19:06 nairabhijit

any success?

DavitVosk avatar Sep 17 '19 16:09 DavitVosk

match this with ur Appdelegate.m

https://github.com/zo0r/react-native-push-notification/blob/master/example/ios/example/AppDelegate.m

zaidraddad94 avatar Apr 25 '20 20:04 zaidraddad94

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 26 '21 00:04 github-actions[bot]