Google Tag Manager

Forum Discussion

RkCode03's avatar
RkCode03
Supporter
4 days ago

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

  • 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

    • RkCode03's avatar
      RkCode03
      Supporter

      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?

      • Manoj__'s avatar
        Manoj__
        Visionary

        Hello RkCode03​  If the code is commented out the the native push prompt shouldn't appear without tapping on the push primer. My assumption is that there is still some code left which is triggering the native push prompt and that also dismisses the push primer