From cbdc700384cf0c4542c7e03daa800f8dff6916f4 Mon Sep 17 00:00:00 2001 From: wesleyorbin Date: Thu, 19 Jan 2023 17:21:10 -0500 Subject: [PATCH 1/4] expo 47 and react native updates --- .../react_native/push_notifications.md | 20 ++++++++++++++++--- .../react_native/react_sdk_setup.md | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md b/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md index f55c270cef2..3dc9024e615 100644 --- a/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md +++ b/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md @@ -19,17 +19,30 @@ Integrating push notifications in React Native requires setting up each native p Set the `enableBrazeIosPush` and `enableFirebaseCloudMessaging` props to enable push for iOS and Android, respectively. +### iOS setup + +#### Generating a New Push Key +If you do not have a previous push key or certificate from Apple, follow [Step 1 of the iOS integration instructions]({{site.baseurl}}developer_guide/platform_integration_guides/ios/push_notifications/integration/#step-1-configure-push-notifications) to generate a new one and upload it to the Braze dashboard. + +#### Migrating a Push Key from expo-notifications +If you were previously using `expo-notifications` to manage your push key, run `expo fetch:ios:certs` from your application's root folder. This will download your push key, which can then be exported as a .p8 file and uploaded to the Braze dashboard. + ### Android setup #### Step 1.1 -Set the `firebaseCloudMessagingSenderId` config prop in your `app.json`. See the [Android integration instructions]({{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration#step-4-set-your-firebase-credentials) on retrieving your sender ID. +Set the `firebaseCloudMessagingSenderId` config prop in your `app.json`. See the [Android integration instructions]({{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration#step-4-set-your-firebase-credentials) on retrieving your sender ID. + +If you'd like the Braze SDK to automatically handle push deep links, set the `androidHandlePushDeepLinksAutomatically` config prop in your `app.json`. #### Step 1.2 -Add your `google-services.json` file to your application's `assets` folder. This file is required when setting `enableFirebaseCloudMessaging: true` in your configuration. +Add your `google-services.json` filepath to your `app.json`. This file is required when setting `enableFirebaseCloudMessaging: true` in your configuration. ```json { "expo": { + "android": { + "googleServicesFile": "PATH_TO_GOOGLE_SERVICES" + }, "plugins": [ [ "@braze/expo-plugin", @@ -38,7 +51,8 @@ Add your `google-services.json` file to your application's `assets` folder. This "iosApiKey": "YOUR-IOS-API-KEY", "enableBrazeIosPush": true, "enableFirebaseCloudMessaging": true, - "firebaseCloudMessagingSenderId": "YOUR-FCM-SENDER-ID" + "firebaseCloudMessagingSenderId": "YOUR-FCM-SENDER-ID", + "androidHandlePushDeepLinksAutomatically": true } ], ] diff --git a/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md b/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md index a788f8761cd..207169717ae 100644 --- a/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md +++ b/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md @@ -18,7 +18,7 @@ To complete the installation, you will need the [App Identifier API key]({{site. ## Step 1: Integrate the Braze library {% alert note %} -Braze React Native SDK v1.38.0+ requires at least React Native v0.64+. +Braze React Native SDK v1.38.0+ requires at least React Native v0.64+. Braze React Native SDK is not yet compatible with the new React Native architecture. {% endalert %} {% tabs local %} From 3d0f589674726ce9c15b9464f119ddb7fb0e0d93 Mon Sep 17 00:00:00 2001 From: wesleyorbin Date: Thu, 19 Jan 2023 17:26:17 -0500 Subject: [PATCH 2/4] add prop to table --- .../react_native/react_sdk_setup.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md b/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md index 207169717ae..a15fa5e4dbd 100644 --- a/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md +++ b/_docs/_developer_guide/platform_integration_guides/react_native/react_sdk_setup.md @@ -51,22 +51,23 @@ expo install @braze/expo-plugin In your `app.json`, add the Braze Expo Plugin. You can provide the following configuration options: -| Method | Type | Description | -| ------------------------------------| ---------| -------------------------------------------------------------------------------------------------------------------------------------------------------| -| `androidApiKey` | string | Required. The API key for your Android application. | -| `iosApiKey` | string | Required. The API key for your iOS application. | -| `baseUrl` | string | Required. The [SDK endpoint]({{site.baseurl}}/api/basics/#endpoints) for your application. | -| `enableBrazeIosPush` | boolean | iOS only. Whether to use Braze to handle push notifications on iOS. Introduced in React Native SDK v1.38.0 and Expo Plugin v0.4.0. | -| `enableFirebaseCloudMessaging` | boolean | Android only. Whether to use Firebase Cloud Messaging for push notifications. Introduced in React Native SDK v1.38.0 and Expo Plugin v0.4.0. | -| `firebaseCloudMessagingSenderId` | string | Android only. Your Firebase Cloud Messaging sender ID. Introduced in React Native SDK v1.38.0 and Expo Plugin v0.4.0. | -| `sessionTimeout` | integer | The Braze session timeout for your application in seconds. | -| `enableSdkAuthentication` | boolean | Whether to enable the [SDK Authentication](https://www.braze.com/docs/developer_guide/platform_wide/sdk_authentication#sdk-authentication) feature. | -| `logLevel` | integer | The log level for your application. The default log level is 8 and will minimally log info. To enable verbose logging for debugging, use log level 0. | -| `minimumTriggerIntervalInSeconds` | integer | The minimum time interval in seconds between triggers. Defaults to 30 seconds. | -| `enableAutomaticLocationCollection` | boolean | Whether automatic location collection is enabled (if the user permits). | -| `enableGeofence` | boolean | Whether geofences are enabled. | -| `enableAutomaticGeofenceRequests` | boolean | Whether geofence requests should be made automatically. | -| `dismissModalOnOutsideTap` | boolean | iOS only. Whether a modal in-app message will be dismissed when the user clicks outside of the in-app message. | +| Method | Type | Description | +| ------------------------------------------| ---------| -------------------------------------------------------------------------------------------------------------------------------------------------------| +| `androidApiKey` | string | Required. The API key for your Android application. | +| `iosApiKey` | string | Required. The API key for your iOS application. | +| `baseUrl` | string | Required. The [SDK endpoint]({{site.baseurl}}/api/basics/#endpoints) for your application. | +| `enableBrazeIosPush` | boolean | iOS only. Whether to use Braze to handle push notifications on iOS. Introduced in React Native SDK v1.38.0 and Expo Plugin v0.4.0. | +| `enableFirebaseCloudMessaging` | boolean | Android only. Whether to use Firebase Cloud Messaging for push notifications. Introduced in React Native SDK v1.38.0 and Expo Plugin v0.4.0. | +| `firebaseCloudMessagingSenderId` | string | Android only. Your Firebase Cloud Messaging sender ID. Introduced in React Native SDK v1.38.0 and Expo Plugin v0.4.0. | +| `sessionTimeout` | integer | The Braze session timeout for your application in seconds. | +| `enableSdkAuthentication` | boolean | Whether to enable the [SDK Authentication](https://www.braze.com/docs/developer_guide/platform_wide/sdk_authentication#sdk-authentication) feature. | +| `logLevel` | integer | The log level for your application. The default log level is 8 and will minimally log info. To enable verbose logging for debugging, use log level 0. | +| `minimumTriggerIntervalInSeconds` | integer | The minimum time interval in seconds between triggers. Defaults to 30 seconds. | +| `enableAutomaticLocationCollection` | boolean | Whether automatic location collection is enabled (if the user permits). | +| `enableGeofence` | boolean | Whether geofences are enabled. | +| `enableAutomaticGeofenceRequests` | boolean | Whether geofence requests should be made automatically. | +| `dismissModalOnOutsideTap` | boolean | iOS only. Whether a modal in-app message will be dismissed when the user clicks outside of the in-app message. | +| `androidHandlePushDeepLinksAutomatically` | boolean | Android only. Whether the Braze SDK should automatically handle push deep links. | {: .reset-td-br-1 .reset-td-br-2 .reset-td-br-3} Example configuration: @@ -86,6 +87,7 @@ Example configuration: "enableBrazeIosPush": false, "enableFirebaseCloudMessaging": false, "firebaseCloudMessagingSenderId": "YOUR-FCM-SENDER-ID", + "androidHandlePushDeepLinksAutomatically": true, "enableSdkAuthentication": false, "logLevel": 0, "minimumTriggerIntervalInSeconds": 0, From 9e71921dc8ea7e2413cc13eac2aeef0dd678b549 Mon Sep 17 00:00:00 2001 From: wesleyorbin Date: Tue, 24 Jan 2023 17:01:11 -0500 Subject: [PATCH 3/4] PR comments --- .../react_native/push_notifications.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md b/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md index 3dc9024e615..ba64861c5ab 100644 --- a/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md +++ b/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md @@ -22,17 +22,17 @@ Set the `enableBrazeIosPush` and `enableFirebaseCloudMessaging` props to enable ### iOS setup #### Generating a New Push Key -If you do not have a previous push key or certificate from Apple, follow [Step 1 of the iOS integration instructions]({{site.baseurl}}developer_guide/platform_integration_guides/ios/push_notifications/integration/#step-1-configure-push-notifications) to generate a new one and upload it to the Braze dashboard. +If you do not have an existing push key or certificate from Apple or want to generate a new one, follow [Step 1 of the iOS integration instructions]({{site.baseurl}}/developer_guide/platform_integration_guides/ios/push_notifications/integration/#step-1-configure-push-notifications) to generate a new push key and upload it to the Braze dashboard. #### Migrating a Push Key from expo-notifications -If you were previously using `expo-notifications` to manage your push key, run `expo fetch:ios:certs` from your application's root folder. This will download your push key, which can then be exported as a .p8 file and uploaded to the Braze dashboard. +If you were previously using `expo-notifications` to manage your push key, run `expo fetch:ios:certs` from your application's root folder. This will download your push key (a .p8 file), which can then be uploaded to the Braze dashboard. ### Android setup #### Step 1.1 Set the `firebaseCloudMessagingSenderId` config prop in your `app.json`. See the [Android integration instructions]({{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration#step-4-set-your-firebase-credentials) on retrieving your sender ID. -If you'd like the Braze SDK to automatically handle push deep links, set the `androidHandlePushDeepLinksAutomatically` config prop in your `app.json`. +If you'd like the Braze SDK to automatically handle push deep links, set `androidHandlePushDeepLinksAutomatically: true` in your `app.json`. #### Step 1.2 Add your `google-services.json` filepath to your `app.json`. This file is required when setting `enableFirebaseCloudMessaging: true` in your configuration. From 58450707eb30db9a88abd274721069f04ddbd919 Mon Sep 17 00:00:00 2001 From: KellieHawks Date: Thu, 26 Jan 2023 10:09:28 -0500 Subject: [PATCH 4/4] Apply suggestions from code review --- .../react_native/push_notifications.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md b/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md index ba64861c5ab..42985fb32dd 100644 --- a/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md +++ b/_docs/_developer_guide/platform_integration_guides/react_native/push_notifications.md @@ -21,10 +21,10 @@ Set the `enableBrazeIosPush` and `enableFirebaseCloudMessaging` props to enable ### iOS setup -#### Generating a New Push Key +#### Generating a new push key If you do not have an existing push key or certificate from Apple or want to generate a new one, follow [Step 1 of the iOS integration instructions]({{site.baseurl}}/developer_guide/platform_integration_guides/ios/push_notifications/integration/#step-1-configure-push-notifications) to generate a new push key and upload it to the Braze dashboard. -#### Migrating a Push Key from expo-notifications +#### Migrating a push key from expo-notifications If you were previously using `expo-notifications` to manage your push key, run `expo fetch:ios:certs` from your application's root folder. This will download your push key (a .p8 file), which can then be uploaded to the Braze dashboard. ### Android setup