Braze React Native SDK - v24.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 one of the following:

      • With the app delegate launch options, call [[BrazeReactUtils sharedInstance] populateInitialPayloadFromLaunchOptions:launchOptions] in your AppDelegate's application:didFinishLaunchingWithOptions: method.
      • With the scene life cycle, call [[BrazeReactUtils sharedInstance] populateInitialPayloadFromNotificationResponse:connectionOptions.notificationResponse] in your SceneDelegate's scene:willConnectToSession:options: 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