I want to disable push notifications for a given user when they log out of my app. I only want to disable notifications for the particular device they logged out of, not for their entire account.

I'm setting a contactKey when registering users so my first thought was to set the contactKey to nil for the logged out device, however contact key cannot be set to nil.

The only other option I see is sfmc_setPushEnabled(_:) but I'm unsure if this preference will be set per contactKey + deviceToken (i.e. per registered device) or for every device associated with the contactKey (i.e. account wide). - Also, what does setting the pushEnabled status look like on the SFMC Mobile Push Portal side, does this affect the status of opted in vs. not yet opted in, or is this state visible in another way?

Using: SFMC iOS SDK 6.2.3 -> MobilePush

  • Calling sfmc_setPushedEnabled(false) will opt-out that particular device for that contact. It could take up to 5 minutes before the changes have propagated through our system. – Jeff Sylvia Jun 21 '19 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.