Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Delay push notification permissions prompt until user opt-in (iOS / React Native) #276

Closed lustig-bakkt closed 3 years ago

lustig-bakkt commented 3 years ago

Report

I've successfully integrated Push Notifications with Braze. However, It appears Braze prompts the user on app open for Permissions to display push notifications regardless of whether or not the user desires to be shown said notifications, resulting in a poor User Experience.

We allow our users to opt in to receiving push notifications, and so would like to defer the Notification Permission dialog to the point after they've opted in. Is this possible?

Describe your environment.

Info Value
Platform Name ios (react-native)
Platform Version e.g. 14
SDK Version e.g. 3.10.0
Integration Method e.g. cocoapods
Xcode Version e.g. Xcode 12
Repro rate e.g. all the time (100%)

What did you do?

Integrate Braze through Cocoapods and follow setup instructions for notifications

What did you expect to happen?

Not for Braze to attempt to greedily handle permissions for push notifications

What happened instead?

Braze greedily asked permission on app startup

Steps to reproduce

Follow push notifications setup Observe greedy app permission request

hokstuff commented 3 years ago

Hi @lustig-bakkt,

The code that requests for the user's authorization to send push is not in the Braze SDK and would likely be in the AppDelegate in the host app (see our example here).

I believe the feature you are requesting is adding a Push Primer before using the native push prompt. Please reference our documentation about how to implement that, and reach out to support@braze.com if you are experiencing issues.

Thank you!

lustig-bakkt commented 3 years ago

@hokstuff That's not quite what I was looking for but I found this which seems like it will be useful.

https://github.com/Appboy/appboy-react-sdk/issues/95#issuecomment-754713491

Will close this after I implement the linked solution.

EDIT: This works with the linked solution above. Closing!