Forum Discussion
Integrate Push primer in mobile app
I’m working on integrating the push primer as part of our app's notification flow. The requirement is to trigger the push primer just before the native OS permission prompt appears, for both Android and iOS.
Currently, it’s not working as expected. Could someone guide me on:
What specific configuration is required in Braze to enable this behavior?Are there any code changes needed in the app to support the push primer flow?
Just for context:
The Braze SDK is already integrated in our codebase. We are successfully receiving push notifications, so the base integration seems fine.
4 Replies
- ashleyatbrazeBraze Employee
There's documentation on this here: https://www.braze.com/docs/user_guide/message_building_by_channel/push/best_practices/push_primer_messages/#prerequisites
- Manoj__Visionary
Hello RkCode03 You will have to remove the code that invokes the native push prompt.
Specially these codes.
For Obejective C:
requestAuthorizationWithOptions
For SWIFT
requestAuthorization
Javascrip
braze.requestPushPermission() // or appboy.registerAppboyPushMessages()
Java
android.permission.POST_NOTIFICATIONS
Disabling this code will disable the native push prompt to automatically appear and But that functionality will now be triggered by the IAM
- RkCode03Supporter
Hi Manoj__ I commented out the suggested code and tested it on Android. I used an action-based trigger condition to show the push primer when the session starts, so that guests would see it during the app launch. However, what's happening is that the primer briefly appears when the app opens, but then it disappears automatically without any user interaction, and the native push notification prompt shows up immediately after.
On iOS, the behavior is reversed — the native push notification prompt appears first, and only then does the push primer show up.
Am I missing something in the configuration, or is there something I might be doing wrong here?
Related Content
- 2 years ago
- 2 years ago
- 4 months ago