React-native-push-notification: Local notification not fired

Created on 19 Jul 2018  路  4Comments  路  Source: zo0r/react-native-push-notification

I configured and tried to push local notification like the example. There are no errors, but no notification is shown in device or simulator. The onNotification is not fired either.

I followed this page to setup for IOS. I have linked the libraries and add the contents to AppDelegate.
https://facebook.github.io/react-native/docs/pushnotificationios.html#content

So I am wondering if this is because I still need to enable notification even for local notifications in the capabilities in xcode? Currently in capabilities I don't have the setting for notification probably because I haven't purchased the Apple Developer Program yet. Can anyone tell me if this is the issue? Thanks

Stale

Most helpful comment

I figured it out...turns out the notification only fires when the app is in the background not in the foreground. And somehow the onNotification is not fired in the PushNotification.configure.

All 4 comments

My understanding was for local notification, I don't need the Apple developer program account. But somehow the notification doesn't fire. Appreciate if anyone can provide advices on what might be the issue or how to debug this. Thanks

I figured it out...turns out the notification only fires when the app is in the background not in the foreground. And somehow the onNotification is not fired in the PushNotification.configure.

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.

This is a iOS design pattern. If the app is in foreground when the notification is triggered then the app should display the message in the app

Was this page helpful?
0 / 5 - 0 ratings