Skip to content

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

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

Closed
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
14 changes: 7 additions & 7 deletions fern/docs/pages/plug-sdk/react-native.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ This functionality 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 @@ -236,7 +236,7 @@ Push notifications require SDK configuration and user identification, whether un
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` should be the Firebase Cloud Messaging (FCM) token value, while on iOS devices, it should be the Apple Push Notification Service (APNS) token.
Expand All @@ -248,7 +248,7 @@ If your app no longer needs to receive push notifications, you can unregister th
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 @@ -263,7 +263,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 @@ -278,20 +278,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.

```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