-
Notifications
You must be signed in to change notification settings - Fork 3
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
Changes from all commits
dfb5c62
13eca83
582efa7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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. | ||||||
|
@@ -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. | ||||||
}); | ||||||
``` | ||||||
|
@@ -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() | ||||||
|
@@ -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. | ||||||
|
@@ -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. | ||||||
|
@@ -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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```typescript | ||||||
DevRevSDK.processPushNotification(payload: string) | ||||||
DevRev.processPushNotification(payload: string) | ||||||
``` | ||||||
|
||||||
For example: | ||||||
|
||||||
```typescript | ||||||
DevRevSDK.processPushNotification(JSON.stringify(payload)); | ||||||
DevRev.processPushNotification(JSON.stringify(payload)); | ||||||
``` | ||||||
|
||||||
## License | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)
fern-api-docs/fern/docs/pages/plug-sdk/react-native.mdx
Line 19 in dfb5c62