You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/docs/pages/plug-sdk/react-native.mdx
+75-25Lines changed: 75 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
This section describes the process of integrating the DevRev SDK with your React Native app.
2
2
3
-
## Installation
3
+
## Quickstart Guide
4
+
### Installation
4
5
5
6
To install the DevRev SDK, run the following command:
6
7
7
8
```sh
8
9
npm install @devrev/sdk-react-native
9
10
```
10
11
11
-
## Set up the DevRev SDK
12
+
###Set up the DevRev SDK
12
13
13
14
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.
14
15
@@ -22,7 +23,8 @@ The SDK will be ready for use once you execute the following configuration metho
22
23
DevRev.configure(appID: string)
23
24
```
24
25
25
-
## Identification
26
+
## Features
27
+
### Identification
26
28
27
29
To access certain features of the DevRev SDK, user identification is required.
28
30
@@ -38,23 +40,30 @@ The `Identity` structure allows for custom fields in the user, organization, and
38
40
39
41
You can select from the following methods to identify users within your application:
40
42
41
-
### Anonymous identification
43
+
####Anonymous identification
42
44
43
45
The anonymous identification method allows you to create an anonymous user with an optional user identifier, ensuring that no other data is stored or associated with the user.
44
46
45
47
```typescript
46
48
DevRev.identifyAnonymousUser(userID: string)
47
49
```
48
50
49
-
### Unverified identification
51
+
####Unverified identification
50
52
51
53
The unverified identification method identifies users with a unique identifier, but it does not verify their identity with the DevRev backend.
Once user identification is complete, you can start using the chat (conversations) dialog supported by our DevRev SDK. The support chat feature can be shown as a modal screen from the top-most screen.
72
81
@@ -80,15 +89,15 @@ To show the support chat screen in your app, you can use the following method:
80
89
DevRev.showSupport()
81
90
```
82
91
83
-
### Creating a new support conversation
92
+
####Creating a new support conversation
84
93
85
94
You can initiate a new support conversation directly from your app. This method displays the support chat screen and simultaneously creates a new conversation.
86
95
87
96
```typescript
88
97
DevRev.createSupportConversation()
89
98
```
90
99
91
-
### In-app link handling
100
+
####In-app link handling
92
101
93
102
In some instances, links opened from the support chat are displayed within the app rather than in a browser. You can manage whether the chat modal should close after a link is opened by using the following method:
Setting this flag to `true` applies the system's default behavior for opening links, which includes dismissing any DevRev modal screens to facilitate handling your own deep links.
The DevRev SDK offers session analytics features to help you understand how users interact with your app.
132
141
133
-
### Opting-in or out
142
+
####Opting-in or out
134
143
135
144
Session analytics features are opted-in by default, enabling them from the start. However, you can opt-out using the following method:
136
145
@@ -144,7 +153,7 @@ To opt back in, use the following method:
144
153
DevRev.resumeAllMonitoring()
145
154
```
146
155
147
-
### Session recording
156
+
####Session recording
148
157
149
158
You can enable session recording to capture user interactions with your app.
150
159
@@ -161,7 +170,7 @@ The session recording feature includes the following methods to control the reco
161
170
|`DevRev.pauseRecording()`| Pauses the ongoing session recording. |
162
171
|`DevRev.resumeRecording()`| Resumes a paused session recording. |
163
172
164
-
### Session properties
173
+
####Session properties
165
174
166
175
You can add custom properties to the session recording to help you understand the context of the session. The properties are defined as a map of string values.
167
176
@@ -175,7 +184,7 @@ To clear the session properties in scenarios such as user logout or when the ses
175
184
DevRev.clearSessionProperties()
176
185
```
177
186
178
-
### Masking sensitive data
187
+
####Masking sensitive data
179
188
180
189
To protect sensitive data, the DevRev SDK provides an auto-masking feature that masks data before sending to the server. Input views such as text fields, text views, and web views are automatically masked.
181
190
@@ -191,7 +200,7 @@ If any previously masked views need to be unmasked, you can use the following me
191
200
DevRev.unmarkSensitiveViews(tags: any[])
192
201
```
193
202
194
-
### Timers
203
+
####Timers
195
204
196
205
The DevRev SDK offers a timer mechanism to measure the time spent on specific tasks, allowing you to track events such as response time, loading time, or any other duration-based metrics.
197
206
@@ -209,25 +218,25 @@ To stop a timer, use the following method:
The DevRev SDK offers automatic screen tracking to help you understand how users navigate through your app. Although view controllers are automatically tracked, you can manually track screens using the following method:
215
224
216
225
```typescript
217
226
DevRev.trackScreen(name: string)
218
227
```
219
228
220
-
## Push notifications
229
+
###Push notifications
221
230
222
231
You can configure your app to receive push notifications from the DevRev SDK. The SDK is designed to handle push notifications and execute actions based on the notification's content.
223
232
224
233
The DevRev backend sends push notifications to your app to alert users about new messages in the PLuG support chat.
225
234
226
-
### Configuration
235
+
####Configuration
227
236
228
237
To receive push notifications, you need to configure your DevRev organization by following the instructions in the [push notifications](./push-notification) section.
229
238
230
-
### Register for push notifications
239
+
####Register for push notifications
231
240
232
241
<Calloutintent="note">
233
242
Push notifications require SDK configuration and user identification, whether unverified or anonymous, to ensure delivery to the correct user.
The method requires the device identifier, which should be the same as the one used when registering the device.
255
264
256
265
257
-
### Processing push notifications
266
+
####Processing push notifications
258
267
259
-
#### Android
268
+
#####Android
260
269
261
270
On Android, notifications are implemented as data messages to offer flexibility. However, this means that automatic click processing isn't available. To handle notification clicks, developers need to intercept the click event, extract the payload, and pass it to a designated method for processing. This custom approach enables tailored notification handling in Android applications.
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 Android, the DevRev SDK provides methods to manually track the screen transitions.
308
+
309
+
When a screen transition begins, you must call the following method:
310
+
311
+
```typescript
312
+
DevRev.startScreenTransition()
313
+
```
314
+
315
+
When a screen transition ends, you must call the following method:
316
+
317
+
```typescript
318
+
DevRev.endScreenTransition()
319
+
```
320
+
321
+
## Troubleshooting
322
+
-**Issue**: Support chat won't show.
323
+
**Solution**: Ensure you have correctly called one of the identification methods: `DevRev.identifyUnverifiedUser(...)`, `DevRev.identifyVerifiedUser(...)`, or `DevRev.identifyAnonymousUser(...)`.
324
+
325
+
-**Issue**: Not receiving push notifications.
326
+
**Solution**: The DevRev SDK reports all errors in the console using Apple's Unified Logging System. Look for error messages in the subsystem `ai.devrev.sdk`.
327
+
328
+
329
+
## Migration Guide
330
+
This guide and chart should help facilitate the transition from the legacy UserExperior SDK to the new DevRev SDK in your React Native application, providing insights into feature equivalents and method changes.
0 commit comments