Skip to content

Commit 5b8142f

Browse files
committed
Update the React Native SDK documentation
1 parent b1ecc20 commit 5b8142f

File tree

2 files changed

+31
-35
lines changed

2 files changed

+31
-35
lines changed

fern/docs/pages/sdks/mobile/react-native/features.mdx

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ This feature is supported only on Android.
218218
For scenarios where custom handling is needed, links from the support chat can be captured with the following method:
219219

220220
```typescript
221-
DevRevSDK.setInAppLinkHandler((url) => {
221+
DevRev.setInAppLinkHandler((url) => {
222222
// Perform an action here.
223223
});
224224
```
@@ -227,16 +227,16 @@ DevRevSDK.setInAppLinkHandler((url) => {
227227

228228
The DevRev SDK allows you to configure the theme dynamically based on the system appearance, or use the theme configured on the DevRev portal. By default, the theme will be dynamic and follow the system appearance.
229229

230-
```swift
230+
```typescript
231231
DevRev.setPrefersSystemTheme(value: boolean)
232232
```
233233

234-
## Analytics
234+
## Analytics
235235

236236
The DevRev SDK allows you to send custom analytic events by using a properties map. You can track these events using the following function:
237237

238238
```typescript
239-
DevRev.trackEvent(name: string, properties?: Map<string, string>)
239+
DevRev.trackEvent(name: string, properties?: { [key: string]: string })
240240
```
241241

242242
## Session analytics
@@ -273,14 +273,14 @@ The session recording feature includes the following methods to control the reco
273273
|`DevRev.stopRecording()` | Stops the session recording and uploads it to the portal. |
274274
|`DevRev.pauseRecording()` | Pauses the ongoing session recording. |
275275
|`DevRev.resumeRecording()` | Resumes a paused session recording. |
276-
|`DevRev.processAllOnDemandSessions()` | Stops the ongoing session recording and uploads all offline sessions on demand, including the current one.|
276+
|`DevRev.processAllOnDemandSessions()` | Stops the ongoing user recording and sends all on-demand sessions along with the current recording. |
277277

278278
### Session properties
279279

280280
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.
281281

282282
```typescript
283-
DevRev.addSessionProperties(properties: Map<string, string>)
283+
DevRev.addSessionProperties(properties: { [key: string]: string })
284284
```
285285

286286
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
@@ -314,21 +314,34 @@ The mechanism uses balanced start and stop methods, both of which accept a timer
314314
To start a timer, use the following method:
315315

316316
```typescript
317-
DevRev.startTimer(name: string, properties: Map<string, string>)
317+
DevRev.startTimer(name: string, properties: { [key: string]: string })
318318
```
319319

320320
To stop a timer, use the following method:
321321

322322
```typescript
323-
DevRev.stopTimer(name: string, properties: Map<string, string>)
323+
DevRev.endTimer(name: string, properties: { [key: string]: string })
324324
```
325325

326326
### Screen tracking
327327

328328
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:
329329

330330
```typescript
331-
DevRev.trackScreen(name: string)
331+
DevRev.trackScreenName(name: string)
332+
```
333+
334+
### Screen transition management (Android only)
335+
336+
The DevRev SDK allows tracking of screen transitions to understand the user navigation within your app.
337+
You can manually update the state using the following methods:
338+
339+
```javascript
340+
// Mark the transition as started.
341+
DevRev.setInScreenTransitioning(true)
342+
343+
// Mark the transition as ended.
344+
DevRev.setInScreenTransitioning(false)
332345
```
333346

334347
## Push notifications
@@ -350,7 +363,7 @@ Push notifications require that the SDK has been configured and the user has bee
350363
The DevRev SDK offers a method to register your device for receiving push notifications. You can register for push notifications using the following method:
351364

352365
```typescript
353-
DevRevSDK.registerDeviceToken(deviceToken: string, deviceID: string)
366+
DevRev.registerDeviceToken(deviceToken: string, deviceID: string)
354367
```
355368

356369
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.
@@ -362,12 +375,11 @@ If your app no longer needs to receive push notifications, you can unregister th
362375
Use the following method to unregister the device:
363376

364377
```typescript
365-
DevRevSDK.unregisterDevice(deviceID: string)
378+
DevRev.unregisterDevice(deviceID: string)
366379
```
367380

368381
The method requires the device identifier, which should be the same as the one used when registering the device.
369382

370-
371383
### Processing push notifications
372384

373385
#### Android
@@ -377,7 +389,7 @@ On Android, notifications are implemented as data messages to offer flexibility.
377389
To process the notification, use the following method:
378390

379391
```typescript
380-
DevRevSDK.processPushNotification(payload: string)
392+
DevRev.processPushNotification(payload: string)
381393
```
382394

383395
Here, the `message` object from the notification payload needs to be passed to this function.
@@ -392,34 +404,18 @@ const notificationPayload = {
392404
}
393405
};
394406
const messageJson = notificationPayload["message"];
395-
DevRevSDK.processPushNotification(JSON.stringify(messageJson));
407+
DevRev.processPushNotification(JSON.stringify(messageJson));
396408
```
397409
#### iOS
398410

399411
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.
400412

401413
```typescript
402-
DevRevSDK.processPushNotification(payload: string)
414+
DevRev.processPushNotification(payload: string)
403415
```
404416

405417
For example:
406418

407419
```typescript
408-
DevRevSDK.processPushNotification(JSON.stringify(payload));
409-
```
410-
411-
### Screen transition tracking (Android only)
412-
413-
On Android, the DevRev SDK provides methods to manually track the screen transitions.
414-
415-
When a screen transition begins, you must call the following method:
416-
417-
```typescript
418-
DevRev.startScreenTransition()
419-
```
420-
421-
When a screen transition ends, you must call the following method:
422-
423-
```typescript
424-
DevRev.endScreenTransition()
420+
DevRev.processPushNotification(JSON.stringify(payload));
425421
```

fern/docs/pages/sdks/mobile/react-native/migration-guide.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ This guide and chart should help facilitate the transition from the legacy UserE
88
| Installation | `npm install react-native-userexperior` | `npm install @devrev/sdk-react-native` |
99
| Initialization | `UserExperior.startRecording(string)` | `DevRev.configure(appID: string)` |
1010
| User Identification | `UserExperior.setUserIdentifier(string)` | `DevRev.identifyAnonymousUser(userID: string)`<br /> `DevRev.identifyUnverifiedUser(identity: Identity)`<br /> `DevRev.updateUser(identity: Identity)`<br /> `DevRev.identifyVerifiedUser(userID: string, sessionToken: string)`<br /> `DevRev.logout(deviceID: string)` |
11-
| Event Tracking | `UserExperior.logEvent(string, Map<string, string>)` | `DevRev.trackEvent(name: string, properties?: Map<string, string>)` |
11+
| Event Tracking | `UserExperior.logEvent(string, Map<string, string>)` | `DevRev.trackEvent(name: string, properties?: { [key: string]: string })` |
1212
| Session Recording | `UserExperior.stopRecording()`<br />`UserExperior.pauseRecording()`<br />`UserExperior.resumeRecording()` | `DevRev.startRecording()`<br />`DevRev.stopRecording()`<br />`DevRev.pauseRecording()`<br />`DevRev.resumeRecording()`<br />`DevRev.processAllOnDemandSessions()` |
1313
| Opting in/out | Not supported. | `DevRev.stopAllMonitoring()`<br /> `DevRev.resumeAllMonitoring()` |
14-
| Session Properties | `UserExperior.setUserProperties(Map<string, string>)` | `DevRev.addSessionProperties(properties: Map<string, string>)`<br /> `DevRev.clearSessionProperties()` |
14+
| Session Properties | `UserExperior.setUserProperties(Map<string, string>)` | `DevRev.addSessionProperties(properties: { [key: string]: string })`<br /> `DevRev.clearSessionProperties()` |
1515
| Masking Sensitive Data | `UserExperior.addInSecureViewBucket(any[])`<br />`UserExperior.removeFromSecureViewBucket(any[])` | `DevRev.markSensitiveViews(tags: any[])`<br />`DevRev.unmarkSensitiveViews(tags: any[])` |
16-
| Timers | Not supported. | `DevRev.startTimer()`<br /> `DevRev.stopTimer()` |
16+
| Timers | Not supported. | `DevRev.startTimer(name: string, properties: { [key: string]: string })`<br /> `DevRev.endTimer(name: string, properties: { [key: string]: string })` |
1717
| PLuG support chat | Not supported. | `DevRev.showSupport()`<br /> `DevRev.createSupportConversation()`<br /> `DevRev.setShouldDismissModalsOnOpenLink()`<br /> `DevRev.setInAppLinkHandler()` |
1818
| Push Notifications | Not supported. | `DevRev.registerDeviceToken()`<br /> `DevRev.unregisterDevice(deviceID: string)`<br /> `DevRev.processPushNotification()` |

0 commit comments

Comments
 (0)