'Allow users to activate push notifications (IOS, react native)

Problem: Users can't activate push notifications after they initially has chosen not to activate them in the app.

When a user first enter the app, a modal is shown with 2 buttons, where the user can accept to recieve push notifications or to do it later.

The activate button uses "PushNotificationIOS.requestPermissions();" which works as intended, the "activate later" button does nothing. The problem is that if the user choses "later", the user cannot later go into the phones app settings to activate push notifications.

Can I activate that setting (so the user can manually activate it sometime later) without prompting the user with the native notifications dialog?



Solution 1:[1]

The notification settings do not appear in the app settings until after you call requestPermissions. They give the user a chance to change the settings that they have approved (or denied).

Showing your own dialog is redundant, since the operating system will show a dialog anyway when you request notification permissions.

You can show an information screen that provides details about the notifications your app will send or the benefits of enabling notifications, but then you should just call requestPermissions and let the user respond to the native dialog

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Paulw11