How to allow users to unsubscribe from push notifications on iOS?
You may want to offer your users a system to disable push notifications from your app.
1. Redirect users to the phone's settings
On iOS, redirecting users to the phone's settings is the only 100% reliable way to disable push notifications.
You can use the [BatchPush openSystemNotificationSettings]
(Objective C) or the BatchPush.openSystemNotificationSettings()
(Swift) method.
You can implement a toggle switch that directs users to the system settings when clicked, allowing them to disable or enable push notifications. To get the right toggle switch state, use the following method.
2. Take advantage of Batch's segmentation engine
However, some apps offer the option to disable push notifications directly within the app.
A. Tag users' optin status
Create a boolean is_push_optin
attribute, true
when users have activated push notifications in the app's settings, false
when they have disabled them.
B. Use this attribute in all your campaign's segmentation
Whenever you create a campaign, include this attribute in your targeting.

Before you choose to use this method, please consider the following points:
This method is network-dependent. If users are not connected to the Internet, the push notifications' disabling will not be immediate.
It can be a source of errors. If you forget to include the attribute in your targeting, you will send notifications to users who indicated they don't want to receive push notifications.
Last updated
Was this helpful?