Braze React Native SDK - v21.0.0
    Preparing search index...

    Function getInitialPushPayload

    • When launching an application that has previously been force closed, React Native's Linking API doesn't support handling push notifications and deep links in the payload. This is due to a race condition on startup between the native call to RCTLinkingManager and React's loading of its JavaScript. This function provides a workaround: If an application is launched from a push notification click, we return the full push payload.

      On iOS, this requires calling [[BrazeReactUtils sharedInstance] populateInitialPayloadFromLaunchOptions:launchOptions] in your AppDelegate's application:didFinishLaunchingWithOptions: method.

      On Android, this requires calling BrazeReactUtils.populateInitialPushPayloadFromIntent(intent) in your MainActivity's onCreate() method.

      See the sample app for example implementations on both platforms.

      Parameters

      • callback: (pushPayload: PushNotificationEvent | null) => void

        A callback that returns the formatted Braze push notification as a PushNotificationEvent. If there is no push payload, returns null.

      Returns void