braze-inc / braze-react-native-sdk

Public repo for the Braze React Native SDK
https://www.braze.com
Other
64 stars 83 forks source link

[Bug]: In-App Notification Timing Issues in React Native Expo App #257

Closed Camus1859 closed 5 months ago

Camus1859 commented 6 months ago

Which Platforms?

Both

Which React Native Version?

0.72.10

Which @braze/react-native-sdk SDK version?

8.4.0

Repro Rate

100%

Steps To Reproduce

Example:

function App.tsx () {

  import Braze from "@braze/react-native-sdk"

  ...

  `Braze.changeUser("myUserId")`
 const permissionOptions = {
    alert: true,
    sound: true,
    badge: true,
    provisional: true,
  };

  Braze.requestPushPermission(permissionOptions);
  }

  ...

app.config.ts

...
    plugins: [
      "react-native-email-link",
      "expo-apple-authentication",
      [
        "@braze/expo-plugin",
        {
          androidApiKey: "...",
          iosApiKey: "...",
          baseUrl: "sdk.iad-05.braze.com",
          enableBrazeIosPush: true,
          enableFirebaseCloudMessaging: true,
          firebaseCloudMessagingSenderId: "...",
          enableSdkAuthentication: true,
          androidNotificationLargeIcon: "@mipmap/ic_launcher",
          androidNotificationSmallIcon: "@mipmap/ic_launcher_round",
          iosRequestPushPermissionsAutomatically: false,
        },
      ],
      [
        "expo-build-properties",
        {
          android: {
            compileSdkVersion: 33,
            targetSdkVersion: 33,
          },
          ios: {
            deploymentTarget: "13.4",
          },
        },
      ],
    ],

Braze dashboard settings:

  1. In Braze Compose Messages section --> Request Push Permission is selected as a button response. Since this is a Push Primer In-App message.

    1. In Braze the Action-Based delivery --> Perform Custom Event is set to Label Generated

    2. The email I want to use is set. Reachable users is at the expected 1

Expected Behavior

  1. When the "Label Generated" event is triggered, the corresponding in-app notification should appear immediately on the user's device

Actual Incorrect Behavior

  1. The in-app notification corresponding to the "Label Generated" event does not appear in real-time. The event logs correctly in the Braze dashboard, so the Overview section for the user shows the event is registered and makes it into Braze as expected but it fails to trigger an immediate in-app notification

Additional Information

  1. The Braze SDK integration works as expected for Push Notifications.
vanessaland commented 6 months ago

Hi @Camus1859 ,

Thanks for reaching out! Here are some things that may help resolve your issue:

If you are still seeing this issue after the above, can you please contact support@braze.com with more details around the logs you are seeing, as well as adding any additional verbose logs? Also, please provide any additional details regarding your push and in-app message implementation. Thank you!