Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

React-Native setUserNotificationsEnabled not working as expected

spyros.lefkaditis

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

Official comment

Avatar

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?

Brian G
Comment actions Permalink

Please sign in to leave a comment.

0
Avatar

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.

spyros.lefkaditis 0 votes
Comment actions Permalink