React-Native setUserNotificationsEnabled not working as expected

I've been following the docs and I've managed to set up Airship just fine on Android devices. However on iOS devices it just doesn't seem to be working as expected.

If I place the setUserNotificationsEnabled function call in the component constructor as outlined in the docs nothing happens upon launching the app in the iOS emulator (the pop up doesn't show asking to approve permissions). Shutting down the app and launching it again has no effect. However, if I launch the app and then refresh the app bundle, I then see the popup asking for permissions. (FYI both times the function is called).

Placing the function call in componentDidUpdate seems to trigger the popup aswell, however that seems like the wrong place to trigger it.

I'm using React v0.59.5 and Airship 3.2.2

Didn't find what you were looking for?

New post

Comments

2 comments

  • iOS emulators do not allow for push notifications by design.

    Is the notification popup displayed on a physical device when you implement our React Native module as per the documentation?

  • Ye I've read that but I can still get the notifications popup showing on emulators. I've also run it on a physical device and the only time I could get the permissions popup to show was when I called the function in componentDidUpdate.

    0

Please sign in to leave a comment.