OneSignal-iOS-SDK icon indicating copy to clipboard operation
OneSignal-iOS-SDK copied to clipboard

[question]: Provisional notifications and optIn/optOut

Open yevgenPaykey opened this issue 1 year ago • 4 comments

How can we help?

I'd like to know what is the proper way to opt in/out when provisional push notifications are activated. Once user opts out and then opts in user sees native push notification permission request which is not the good UX. I'd like user to remain on provisional permission after opting in. I've tried to run optIn via rest api (to avoid having permission popup) but get an error: {"errors":[{"code":"subscription-7","title":"Subscription can't be enabled due to an error reported by the SDK. Check notification_type value for a specific reason code"}]}%

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

yevgenPaykey avatar Oct 18 '24 13:10 yevgenPaykey

Hi @yevgenPaykey thanks for your question.

There is not a way to opt a user out and then opt back in provisionally.

Can you explain why the permission request is poor UX?

The user has chosen to opt out and then chosen to opt in again - I would expect a push permission prompt to be appropriate in this case.

nan-li avatar Oct 29 '24 22:10 nan-li

hi @nan-li Thanks for the reply. I opt out user programmatically when user logs out. In this case I don't want user to receive push notification since there is no user at this moment. And then when user logs in again I programmatically opt user in and expect SDK to continue in provisional mode. I request full permission later on during "happy moment" when user performs app's main feature successfully. I don't want to request full permission upon logging in. Hope this helped to understand the problem better

yevgenPaykey avatar Oct 30 '24 08:10 yevgenPaykey

@yevgenPaykey I see, and you have notifications that are sent to ALL users?

The workaround is to send notifications to users by external ID only, which I don't know if that is feasible for you.

nan-li avatar Dec 05 '24 18:12 nan-li

@nan-li yes the sending logic takes userId into account for sure. The problem in this scenario is more about user receiving full permission request alert upon login after logout.

yevgenPaykey avatar Dec 06 '24 07:12 yevgenPaykey