Skip to content

Commit 920bf93

Browse files
authored
ISS-197886: Update the mobile SDK callouts (#289)
* Fix the Android SDK callouts * Fix the iOS SDK callouts * Fix the React Native and Expo SDK callouts * Fix the Cordova SDK callouts * Fix the Flutter SDK callouts * Fix a missing callout in the Cordova SDK * Follow the language recommendation by EKLine in the mobile SDKs * Fix a present tense issue in the mobile SDKs * Fix the case of a heading * Use the proper verb for switching directories * Update the iOS quickstart * Fix the slug for the push notifications guide
1 parent a435333 commit 920bf93

23 files changed

+287
-242
lines changed

fern/docs/pages/sdks/mobile/android/features.mdx

Lines changed: 73 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To access certain features of the DevRev SDK, user identification is required.
66

77
The identification function should be placed appropriately in your app after the user logs in. If you have the user information available at app launch, call the function after the `DevRev.configure(context, appID)` method.
88

9-
<Callout intent="note">
9+
<Callout intent="tip">
1010
The `Identity` structure allows for custom fields in the user, organization, and account traits. These fields must be configured through the DevRev app before they can be utilized. For more information, refer to [Object customization](https://devrev.ai/docs/product/object-customization).
1111
</Callout>
1212

@@ -48,7 +48,7 @@ The unverified identification method identifies users with a unique identifier,
4848
DevRev.INSTANCE.identifyUnverifiedUser(
4949
Identity identity
5050
);
51-
```
51+
```
5252
</Tab>
5353
</Tabs>
5454

@@ -73,7 +73,6 @@ For example:
7373
</Tab>
7474
</Tabs>
7575

76-
7776
### Verified identification
7877

7978
The verified identification method is used to identify users with an identifier unique to your system within the DevRev platform. The verification is done through a token exchange process between you and the DevRev backend.
@@ -83,25 +82,30 @@ The steps to identify a verified user are as follows:
8382
2. Exchange your AAT for a session token for each user of your system.
8483
3. Pass the user identifier and the exchanged session token to the `DevRev.identifyVerifiedUser(_:sessionToken:)` method.
8584

86-
> [!CAUTION]
87-
> For security reasons we **strongly recommend** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
85+
<Callout intent="warning">
86+
For security reasons, it is **strongly recommended** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
87+
</Callout>
8888

8989
#### Generate an AAT
9090

9191
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
9292
2. Open the **PLuG Tokens** page.
9393
3. Under the **Application access tokens** panel, click **New token** and copy the token that's displayed.
9494

95-
> [!IMPORTANT]
96-
> Ensure that you copy the generated application access token, as you cannot view it again.
95+
<Callout intent="warning">
96+
Ensure that you copy the generated application access token, as you cannot view it again.
97+
</Callout>
9798

9899
#### Exchange your AAT for a session token
99100

100-
In order to proceed with identifying the user, you need to exchange your AAT for a session token. This step will help you identify a user of your own system within the DevRev platform.
101+
To proceed with identifying the user, you need to exchange your AAT for a session token. This step helps you identify a user of your own system within the DevRev platform.
101102

102103
Here is a simple example of an API request to the DevRev backend to exchange your AAT for a session token:
103-
> [!CAUTION]
104-
> Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
104+
105+
<Callout intent="warning">
106+
Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
107+
</Callout>
108+
105109
```bash
106110
curl \
107111
--location 'https://api.devrev.ai/auth-tokens.create' \
@@ -115,10 +119,11 @@ curl \
115119
}'
116120
```
117121

118-
The response of the API call will contain a session token that you can use with the verified identification method in your app.
122+
The response of the API call contains a session token that you can use with the verified identification method in your app.
119123

120-
> [!NOTE]
121-
> As a good practice, **your** app should retrieve the exchanged session token from **your** backend at app launch or any relevant app lifecycle event.
124+
<Callout intent="warning">
125+
As a good practice, **your** app should retrieve the exchanged session token from **your** backend at app launch or any relevant app lifecycle event.
126+
</Callout>
122127

123128
#### Identifying the verified user
124129

@@ -160,7 +165,7 @@ DevRev.INSTANCE.updateUser(
160165

161166
The function accepts the `DevRev.Identity` ojbect.
162167

163-
<Callout intent="note">
168+
<Callout intent="warning">
164169
The `userID` property cannot be updated.
165170
</Callout>
166171

@@ -181,7 +186,7 @@ You can perform a logout of the current user by calling the following method:
181186
</Tab>
182187
</Tabs>
183188

184-
The user will be logged out by clearing their credentials, as well as unregistering the device from receiving push notifications, and stopping the session recording.
189+
The user is logged out by clearing their credentials, as well as unregistering the device from receiving push notifications, and stopping the session recording.
185190

186191
### Identity model
187192

@@ -200,15 +205,18 @@ The `Identity` class contains the following properties:
200205
| `organizationTraits` | `OrganizationTraits?` || Additional information about the organization |
201206
| `accountTraits` | `AccountTraits?` || Additional information about the account |
202207

203-
> [!NOTE]
204-
> The custom fields properties defined as part of the user, organization and account traits, must be configured in the DevRev web app **before** they can be used. See [Object customization](https://devrev.ai/docs/product/object-customization) for more information.
208+
<Callout intent="note">
209+
The custom fields properties defined as part of the user, organization and account traits, must be configured in the DevRev web app **before** they can be used. See [Object customization](https://devrev.ai/docs/product/object-customization) for more information.
210+
</Callout>
205211

206-
##### UserTraits
212+
##### User traits
207213

208214
The `UserTraits` class contains detailed information about the user:
209215

210-
> [!NOTE]
211-
> All properties in `UserTraits` are optional.
216+
<Callout intent="note">
217+
All properties in `UserTraits` are optional.
218+
</Callout>
219+
212220
| Property | Type | Description |
213221
|----------|------|-------------|
214222
| `displayName` | `String?` | The displayed name of the user |
@@ -218,12 +226,14 @@ The `UserTraits` class contains detailed information about the user:
218226
| `phoneNumbers` | `[String]?` | Array of the user's phone numbers |
219227
| `customFields` | `[String: Any]?` | Dictionary of custom fields configured in DevRev |
220228

221-
##### OrganizationTraits
229+
##### Organization traits
222230

223231
The `OrganizationTraits` class contains detailed information about the organization:
224232

225-
> [!NOTE]
226-
> All properties in `OrganizationTraits` are optional.
233+
<Callout intent="note">
234+
All properties in `OrganizationTraits` are optional.
235+
</Callout>
236+
227237
| Property | Type | Description |
228238
|----------|------|-------------|
229239
| `displayName` | `String?` | The displayed name of the organization |
@@ -233,12 +243,14 @@ The `OrganizationTraits` class contains detailed information about the organizat
233243
| `tier` | `String?` | The organization's tier or plan level |
234244
| `customFields` | `[String: Any]?` | Dictionary of custom fields configured in DevRev |
235245

236-
##### AccountTraits
246+
##### Account traits
237247

238248
The `AccountTraits` class contains detailed information about the account:
239249

240-
> [!NOTE]
241-
> All properties in `AccountTraits` are optional.
250+
<Callout intent="note">
251+
All properties in `AccountTraits` are optional.
252+
</Callout>
253+
242254
| Property | Type | Description |
243255
|----------|------|-------------|
244256
| `displayName` | `String?` | The displayed name of the account |
@@ -257,12 +269,12 @@ Once user identification is complete, you can start using the chat (conversation
257269
<Tab title="Kotlin">
258270
```kotlin
259271
DevRev.showSupport(context: Context)
260-
```
272+
```
261273
</Tab>
262274
<Tab title="Java">
263275
```java
264276
DevRevExtKt.showSupport(DevRev.INSTANCE, context);
265-
```
277+
```
266278
</Tab>
267279
</Tabs>
268280

@@ -274,12 +286,12 @@ You have the ability to create a new conversation from within your app. The meth
274286
<Tab title="Kotlin">
275287
```kotlin
276288
DevRev.createSupportConversation(context: Context)
277-
```
289+
```
278290
</Tab>
279291
<Tab title="Java">
280292
```java
281293
DevRev.INSTANCE.createSupportConversation(context);
282-
```
294+
```
283295
</Tab>
284296
</Tabs>
285297

@@ -479,12 +491,12 @@ Using this property will return the status of the session recording:
479491
<Tab title="Kotlin">
480492
```kotlin
481493
DevRev.isRecording
482-
```
494+
```
483495
</Tab>
484496
<Tab title="Java">
485497
```java
486498
DevRevObservabilityExtKt.isRecording(DevRev.INSTANCE);
487-
```
499+
```
488500
</Tab>
489501
</Tabs>
490502

@@ -494,12 +506,12 @@ To check if on-demand sessions are enabled, use:
494506
<Tab title="Kotlin">
495507
```kotlin
496508
DevRev.areOnDemandSessionsEnabled
497-
```
509+
```
498510
</Tab>
499511
<Tab title="Java">
500512
```java
501513
DevRevObservabilityExtKt.areOnDemandSessionsEnabled(DevRev.INSTANCE);
502-
```
514+
```
503515
</Tab>
504516
</Tabs>
505517

@@ -511,12 +523,12 @@ You can add custom properties to the session recording to help you understand th
511523
<Tab title="Kotlin">
512524
```kotlin
513525
DevRev.addSessionProperties(properties: HashMap<String, Any>)
514-
```
526+
```
515527
</Tab>
516528
<Tab title="Java">
517529
```java
518530
DevRevObservabilityExtKt.addSessionProperties(DevRev.INSTANCE, HashMap<String, Object> properties);
519-
```
531+
```
520532
</Tab>
521533
</Tabs>
522534

@@ -545,8 +557,8 @@ While the auto-masking feature may be sufficient for most situations, you can ma
545557

546558
##### Using tag
547559

548-
<Callout intent="note">
549-
Use Tag method only when you don't have any other tag already applied to your UI element.
560+
<Callout intent="tip">
561+
Use the tag method only when you don't have any other tag already applied to your UI element.
550562
</Callout>
551563

552564
```xml
@@ -581,7 +593,6 @@ You can also set the tag programmatically:
581593
</Tab>
582594
</Tabs>
583595

584-
585596
##### Using API
586597

587598
<Tabs>
@@ -626,8 +637,8 @@ For example:
626637

627638
##### Using tag
628639

629-
<Callout intent="note">
630-
Use Tag method only when you don't have any other tag already applied to your UI element.
640+
<Callout intent="tip">
641+
Use the tag method only when you don't have any other tag already applied to your UI element.
631642
</Callout>
632643

633644
```xml
@@ -748,22 +759,22 @@ For advanced use cases, you can provide a custom masking provider to explicitly
748759

749760
You can implement your own masking logic by creating a class that implements the `MaskLocationProvider` interface and setting your custom object as the masking provider. This allows you to specify explicit regions to be masked or to skip snapshots entirely.
750761

751-
- `DevRev.setMaskLocationProvider(maskLocationProvider: MaskLocationProvider)`
762+
- `DevRev.setMaskLocationProvider(maskLocationProvider: MaskLocationProvider)`
752763
Sets a custom provider that determines which UI regions should be masked during snapshots. This overrides any previously set provider.
753764

754-
- `MaskLocationProvider`
765+
- `MaskLocationProvider`
755766
Interface that must be implemented to return a `SnapshotMask` object containing masked regions and snapshot behavior.
756767

757-
- `SnapshotMask`
768+
- `SnapshotMask`
758769
Class used to describe regions of the screen to be masked and whether a snapshot should be skipped.
759770

760-
- `SnapshotMask.Location`
771+
- `SnapshotMask.Location`
761772
Represents a specific rectangular area of the screen that should be masked.
762773

763774
#### Example
764775

765776
<Tabs>
766-
<Tab title="Kotlin">
777+
<Tab title="Kotlin">
767778
```kotlin
768779
import com.userexperior.bridge.model.MaskLocationProvider
769780
import com.userexperior.bridge.model.SnapshotMask
@@ -806,7 +817,7 @@ You can implement your own masking logic by creating a class that implements the
806817
</Tab>
807818
</Tabs>
808819

809-
<Callout intent="note">
820+
<Callout intent="tip">
810821
Setting a new provider overrides any previously set masking location provider.
811822
</Callout>
812823

@@ -822,12 +833,12 @@ To start a timer, use the following method:
822833
<Tab title="Kotlin">
823834
```kotlin
824835
DevRev.startTimer(name: String, properties: HashMap<String, String>)
825-
```
836+
```
826837
</Tab>
827838
<Tab title="Java">
828839
```java
829840
DevRevObservabilityExtKt.startTimer(DevRev.INSTANCE, String name, HashMap<String, String> properties);
830-
```
841+
```
831842
</Tab>
832843
</Tabs>
833844

@@ -852,18 +863,18 @@ For example:
852863
<Tab title="Kotlin">
853864
```kotlin
854865
DevRev.startTimer("response-time", properties: {"id": "task-1337"})
855-
866+
856867
// Perform the task that you want to measure.
857-
868+
858869
DevRev.endTimer("response-time", properties: {"id": "task-1337"})
859-
```
870+
```
860871
</Tab>
861872
<Tab title="Java">
862873
```java
863874
DevRevObservabilityExtKt.startTimer(DevRev.INSTANCE, "response-time", new HashMap<String, String>().put("id", "task-1337"));
864-
875+
865876
// Perform the task that you want to measure.
866-
877+
867878
DevRevObservabilityExtKt.endTimer(DevRev.INSTANCE, "response-time", new HashMap<String, String>().put("id", "task-1337"));
868879
```
869880
</Tab>
@@ -944,16 +955,15 @@ You can configure your app to receive push notifications from the DevRev SDK. Th
944955

945956
The DevRev backend sends push notifications to your app to notify users about new messages in the PLuG support chat.
946957

947-
<Callout intent="note">
948-
To receive push notifications, you need to configure your DevRev organization by following the instructions in the [push notifications](../push-notification) section.
958+
### Configuration
949959

950-
You need to ensure that your Android app is configured to receive push notifications. To set it up, follow the [Firebase documentation](https://firebase.google.com/docs/cloud-messaging/android/client).
951-
</Callout>
960+
To receive push notifications, you need to configure your DevRev organization by following the instructions in the [push notifications](../push-notifications) section.
952961

962+
You need to ensure that your Android app is configured to receive push notifications. You can follow the [Android documentation](https://developer.android.com/training/notify-user/build-notification) for guidance on registering your app with Firebase Cloud Messaging (FCM).
953963

954964
### Register for push notifications
955965

956-
<Callout intent="note">
966+
<Callout intent="tip">
957967
Push notifications require that the SDK has been configured and the user has been identified (unverified and anonymous users). The user identification is required to send the push notification to the correct user.
958968
</Callout>
959969

@@ -1005,15 +1015,15 @@ The method requires the device identifier, which should be the same as the one u
10051015
<Tab title="Kotlin">
10061016
```kotlin
10071017
DevRev.unregisterDevice(
1008-
context: Context,
1018+
context: Context,
10091019
deviceId: String
10101020
)
10111021
```
10121022
</Tab>
10131023
<Tab title="Java">
10141024
```java
10151025
DevRev.INSTANCE.unregisterDevice(
1016-
Context context,
1026+
Context context,
10171027
String deviceId
10181028
);
10191029
```
@@ -1073,7 +1083,7 @@ For example:
10731083
```kotlin
10741084
class MyFirebaseMessagingService: FirebaseMessagingService {
10751085
// ...
1076-
1086+
10771087
override fun onMessageReceived(remoteMessage: RemoteMessage) {
10781088
// ...
10791089
val messageData = remoteMessage.data["message"]
@@ -1086,7 +1096,7 @@ For example:
10861096
```java
10871097
public class MyFirebaseMessagingService extends FirebaseMessagingService {
10881098
// ...
1089-
1099+
10901100
@Override
10911101
public void onMessageReceived(RemoteMessage remoteMessage) {
10921102
// ...

0 commit comments

Comments
 (0)