Opt users in or out of Pulsate push notifications with setPushNotificationEnabled, and read the current preference.
Use setPushNotificationEnabled(_:) to opt a user in or out of Pulsate push notifications. This affects only pushes that Pulsate sends. By default, all users are opted in.
Opt in / opt out
import PULPulsate
guard let manager = PULPulsateFactory.getDefaultInstance() else { return }
manager.setPushNotificationEnabled(true) // Opt in
manager.setPushNotificationEnabled(false) // Opt out
Reading the current preference
To check whether the current user is opted in or out, use isPushNotificationEnabled():
if manager.isPushNotificationEnabled() {
// User currently receives Pulsate pushes
}
Important
Changes are debounced — the SDK waits up to ~60 seconds before syncing a new preference to the backend, so a rapid toggle sends only the final value.
Behavior when opted out
When a user is opted out of push notifications, they will not receive any push notifications from Pulsate — this includes both Campaigns and Converse Messages. Opted-out users still:
- receive In-App Notifications, and
- receive campaign feed post in the Pulsate Feed, including feed posts from push-notification campaigns.

