Skip to content

Commit abcbe64

Browse files
committed
Fix the Cordova SDK callouts
1 parent 39c235d commit abcbe64

File tree

2 files changed

+36
-31
lines changed

2 files changed

+36
-31
lines changed

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

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ 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(appID)` method.
88

9-
<Callout intent="note">
9+
<Callout intent="tip">
1010
On iOS, if you haven't previously identified the user, the DevRev SDK will automatically create an anonymous user for you immediately after the SDK is configured.
1111
</Callout>
1212

13-
<Callout intent="note">
13+
<Callout intent="tip">
1414
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).
1515
</Callout>
1616

@@ -41,25 +41,30 @@ The steps to identify a verified user are as follows:
4141
2. Exchange your AAT for a session token for each user of your system.
4242
3. Pass the user identifier and the exchanged session token to the `DevRev.identifyVerifiedUser(_:sessionToken:)` method.
4343

44-
> [!CAUTION]
45-
> For security reasons we **strongly recommend** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
44+
<Callout intent="warning">
45+
For security reasons we **strongly recommend** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
46+
</Callout>
4647

4748
#### Generate an AAT
4849

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

53-
> [!IMPORTANT]
54-
> Ensure that you copy the generated application access token, as you cannot view it again.
54+
<Callout intent="warning">
55+
Ensure that you copy the generated application access token, as you cannot view it again.
56+
</Callout>
5557

5658
#### Exchange your AAT for a session token
5759

5860
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.
5961

6062
Here is a simple example of an API request to the DevRev backend to exchange your AAT for a session token:
61-
> [!CAUTION]
62-
> Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
63+
64+
<Callout intent="warning">
65+
Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
66+
</Callout>
67+
6368
```bash
6469
curl \
6570
--location 'https://api.devrev.ai/auth-tokens.create' \
@@ -75,8 +80,9 @@ curl \
7580

7681
The response of the API call will contain a session token that you can use with the verified identification method in your app.
7782

78-
> [!NOTE]
79-
> As a good practice, **your** app should retrieve the exchanged session token from **your** backend at app launch or any relevant app lifecycle event.
83+
<Callout intent="warning">
84+
As a good practice, **your** app should retrieve the exchanged session token from **your** backend at app launch or any relevant app lifecycle event.
85+
</Callout>
8086

8187
#### Identifying the verified user
8288

@@ -94,7 +100,7 @@ You can update the user's information using the following method:
94100
DevRev.updateUser(identity, successCallback, errorCallback)
95101
```
96102

97-
<Callout intent="note">
103+
<Callout intent="warning">
98104
The `userID` property cannot be updated.
99105
</Callout>
100106

@@ -123,15 +129,18 @@ The `Identity` class contains the following properties:
123129
| `organizationTraits` | `OrganizationTraits OR null` || Additional information about the organization |
124130
| `accountTraits` | `AccountTraits OR null` || Additional information about the account |
125131

126-
> [!NOTE]
127-
> 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.
132+
<Callout intent="note">
133+
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.
134+
</Callout>
128135

129136
##### UserTraits
130137

131138
The `UserTraits` class contains detailed information about the user:
132139

133-
> [!NOTE]
134-
> All properties in `UserTraits` are optional.
140+
<Callout intent="note">
141+
All properties in `UserTraits` are optional.
142+
</Callout>
143+
135144
| Property | Type | Description |
136145
|----------|------|-------------|
137146
| `displayName` | `string OR null` | The displayed name of the user |
@@ -144,8 +153,10 @@ The `UserTraits` class contains detailed information about the user:
144153

145154
The `OrganizationTraits` class contains detailed information about the organization:
146155

147-
> [!NOTE]
148-
> All properties in `OrganizationTraits` are optional.
156+
<Callout intent="note">
157+
All properties in `OrganizationTraits` are optional.
158+
</Callout>
159+
149160
| Property | Type | Description |
150161
|----------|------|-------------|
151162
| `displayName` | `string OR null` | The displayed name of the organization |
@@ -159,8 +170,10 @@ The `OrganizationTraits` class contains detailed information about the organizat
159170

160171
The `AccountTraits` class contains detailed information about the account:
161172

162-
> [!NOTE]
163-
> All properties in `AccountTraits` are optional.
173+
<Callout intent="note">
174+
All properties in `AccountTraits` are optional.
175+
</Callout>
176+
164177
| Property | Type | Description |
165178
|----------|------|-------------|
166179
| `displayName` | `string or null` | The displayed name of the account |
@@ -177,10 +190,6 @@ The user will be logged out by clearing their credentials, as well as unregister
177190

178191
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.
179192

180-
<Callout intent="note">
181-
This functionality requires the SDK to be configured and the user to be identified, whether they are unverified or anonymous.
182-
</Callout>
183-
184193
To show the support chat screen in your app, you can use the following method:
185194

186195
```javascript
@@ -215,10 +224,6 @@ DevRev.setShouldDismissModalsOnOpenLink(value, successCallback, errorCallback)
215224

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

218-
<Callout intent="note">
219-
This functionality requires the SDK to be configured and the user to be identified, whether they are unverified or anonymous.
220-
</Callout>
221-
222227
```javascript
223228
DevRev.trackEvent(name, properties, successCallback, errorCallback)
224229
```
@@ -266,7 +271,7 @@ You can add custom properties to the session recording to help you understand th
266271
DevRev.addSessionProperties(properties, successCallback, errorCallback)
267272
```
268273

269-
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
274+
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
270275

271276
```javascript
272277
DevRev.clearSessionProperties(successCallback, errorCallback)
@@ -340,7 +345,7 @@ On Android devices, the `deviceToken` should be the Firebase Cloud Messaging (FC
340345

341346
### Unregister from push notifications
342347

343-
If your app no longer needs to receive push notifications, you can unregister the device.
348+
If your app no longer needs to receive push notifications, you can unregister the device.
344349

345350
Use the following method to unregister the device:
346351

@@ -387,7 +392,7 @@ DevRev.processPushNotification(messageJson, function() {
387392

388393
#### iOS
389394

390-
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.
395+
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.
391396

392397
```javascript
393398
DevRev.processPushNotification(payload, successCallback, errorCallback)

fern/docs/pages/sdks/mobile/cordova/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ npm install @devrev/sdk-cordova
2121
2. Under **PLuG settings**, copy the value under **Your unique App ID**.
2222
3. After obtaining the credentials, configure the DevRev SDK in your app.
2323

24-
<Callout intent="note">
24+
<Callout intent="warning">
2525
The DevRev SDK must be configured before you can use any of its features.
2626
</Callout>
2727

0 commit comments

Comments
 (0)