Skip to content

ISS-163753: Update the React Native SDK guide to unify the public entry point #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions fern/docs/pages/plug-sdk/react-native.mdx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine]

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

The SDK will be ready for use once you execute the following configuration method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine]

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

On iOS, if you haven't previously identified the user, the DevRev SDK will automatically create an anonymous user for you immediately after the SDK is configured.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine]

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

If a custom handler is not defined, all external and in-app links from the support chat will open using the system's default browser, such as Chrome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine]

Consider using 'go' instead of 'navigate'. (EK25033)

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ npm install @devrev/sdk-react-native

## Set up the DevRev SDK

In DevRev, go to **Settings** > **PLuG Chat** copy the value under **Your unique App ID**. After obtaining the credentials, you can configure the DevRev SDK in your app.
In DevRev, go to **Settings** > **PLuG Chat** copy the value under **Your unique App ID**. After obtaining the credentials, you can configure the DevRev SDK in your app.

<Callout intent="note">
The DevRev SDK must be configured before you can use any of its features.
Expand Down Expand Up @@ -107,7 +107,7 @@ This feature is for Android only.
For scenarios where custom handling is needed, links from the support chat can be captured with the following method:

```typescript
DevRevSDK.setInAppLinkHandler((url) => {
DevRev.setInAppLinkHandler((url) => {
// Perform an action here.
});
```
Expand Down Expand Up @@ -170,7 +170,7 @@ You can add custom properties to the session recording to help you understand th
DevRev.addSessionProperties(properties: Map<string, string>)
```

To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:

```typescript
DevRev.clearSessionProperties()
Expand Down Expand Up @@ -237,19 +237,19 @@ To ensure delivery to the correct user, push notifications require that the SDK
The DevRev SDK offers a method to register your device for receiving push notifications. You can register for push notifications using the following method:

```typescript
DevRevSDK.registerDeviceToken(deviceToken: string, deviceID: string)
DevRev.registerDeviceToken(deviceToken: string, deviceID: string)
```

On Android devices, the `deviceToken` must be the Firebase Cloud Messaging (FCM) token value. On iOS devices, it must be the Apple Push Notification Service (APNs) token.

### Unregister from push notifications

If your app no longer needs to receive push notifications, you can unregister the device.
If your app no longer needs to receive push notifications, you can unregister the device.

Use the following method to unregister the device:

```typescript
DevRevSDK.unregisterDevice(deviceID: string)
DevRev.unregisterDevice(deviceID: string)
```

The method requires the device identifier, which should be the same as the one used when registering the device.
Expand All @@ -264,7 +264,7 @@ On Android, notifications are implemented as data messages to offer flexibility.
To process the notification, use the following method:

```typescript
DevRevSDK.processPushNotification(payload: string)
DevRev.processPushNotification(payload: string)
```

Here, the `message` object from the notification payload should be passed to this function.
Expand All @@ -279,20 +279,20 @@ const notificationPayload = {
}
};
const messageJson = notificationPayload["message"];
DevRevSDK.processPushNotification(JSON.stringify(messageJson));
DevRev.processPushNotification(JSON.stringify(messageJson));
```
#### iOS

On iOS devices, you must pass the received push notification payload to the DevRev SDK for processing. The SDK will then handle the notification and execute the necessary actions.
On iOS devices, you must pass the received push notification payload to the DevRev SDK for processing. The SDK will then handle the notification and execute the necessary actions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine]

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

Suggested change
On iOS devices, you must pass the received push notification payload to the DevRev SDK for processing. The SDK will then handle the notification and execute the necessary actions.
On iOS devices, you must pass the received push notification payload to the DevRev SDK for processing. The SDK handles the notification and executes the necessary actions.


```typescript
DevRevSDK.processPushNotification(payload: string)
DevRev.processPushNotification(payload: string)
```

For example:

```typescript
DevRevSDK.processPushNotification(JSON.stringify(payload));
DevRev.processPushNotification(JSON.stringify(payload));
```

## License
Expand Down
Loading