Skip to content

Commit df807e8

Browse files
committed
Revert Cordova until the API issues are resolved
1 parent cc429a1 commit df807e8

File tree

4 files changed

+35
-201
lines changed

4 files changed

+35
-201
lines changed

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

Lines changed: 24 additions & 162 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="tip">
9+
<Callout intent="note">
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="tip">
13+
<Callout intent="note">
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

@@ -21,7 +21,7 @@ You can select from the following methods to identify users within your applicat
2121
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.
2222

2323
```javascript
24-
DevRev.identifyAnonymousUser(userID, successCallback, errorCallback)
24+
DevRev.identifyAnonymousUser(successCallback, errorCallback)
2525
```
2626

2727
### Unverified identification
@@ -34,62 +34,10 @@ DevRev.identifyUnverifiedUser(identity, successCallback, errorCallback)
3434

3535
### Verified identification
3636

37-
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.
38-
39-
The steps to identify a verified user are as follows:
40-
1. Generate an AAT for your system (preferably through your backend).
41-
2. Exchange your AAT for a session token for each user of your system.
42-
3. Pass the user identifier and the exchanged session token to the `DevRev.identifyVerifiedUser(_:sessionToken:)` method.
43-
44-
<Callout intent="warning">
45-
For security reasons, it is **strongly recommended** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
46-
</Callout>
47-
48-
#### Generate an AAT
49-
50-
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
51-
2. Open the **PLuG Tokens** page.
52-
3. Under the **Application access tokens** panel, click **New token** and copy the token that's displayed.
53-
54-
<Callout intent="warning">
55-
Ensure that you copy the generated application access token, as you cannot view it again.
56-
</Callout>
57-
58-
#### Exchange your AAT for a session token
59-
60-
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.
61-
62-
Here is a simple example of an API request to the DevRev backend to exchange your AAT for a session token:
63-
64-
<Callout intent="warning">
65-
Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
66-
</Callout>
67-
68-
```bash
69-
curl \
70-
--location 'https://api.devrev.ai/auth-tokens.create' \
71-
--header 'accept: application/json, text/plain, */*' \
72-
--header 'content-type: application/json' \
73-
--header 'authorization: <AAT>' \
74-
--data '{
75-
"rev_info": {
76-
"user_ref": "<YOUR_USER_ID>"
77-
}
78-
}'
79-
```
80-
81-
The response of the API call contains a session token that you can use with the verified identification method in your app.
82-
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>
86-
87-
#### Identifying the verified user
88-
89-
Pass the user identifier and the exchanged session token to the verified identification method:
37+
The verified identification method identifies users with a unique identifier and verifies their identity with the DevRev backend.
9038

9139
```javascript
92-
DevRev.identifyVerifiedUser(userID, sessionToken, successCallback, errorCallback)
40+
DevRev.identifyVerifiedUser(identity, successCallback, errorCallback)
9341
```
9442

9543
### Update the user
@@ -100,7 +48,7 @@ You can update the user's information using the following method:
10048
DevRev.updateUser(identity, successCallback, errorCallback)
10149
```
10250

103-
<Callout intent="warning">
51+
<Callout intent="note">
10452
The `userID` property cannot be updated.
10553
</Callout>
10654

@@ -112,84 +60,16 @@ You can log out the current user by using the following method:
11260
DevRev.logout(deviceID, successCallback, errorCallback)
11361
```
11462

115-
The user is logged out by clearing their credentials, as well as unregistering the device from receiving push notifications, and stopping the session recording.
116-
117-
### Identity model
118-
119-
The `Identity` interface is used to provide user, organization, and account information when identifying users or updating their details. This class is used primarily with the `identifyUnverifiedUser` and `updateUser` methods.
120-
121-
#### Properties
63+
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.
12264

123-
The `Identity` class contains the following properties:
124-
125-
| Property | Type | Required | Description |
126-
|----------|------|----------|-------------|
127-
| `userRef` | `string` || A unique identifier for the user |
128-
| `organizationRef` | `string OR null` || An identifier for the user's organization |
129-
| `accountRef` | `string OR null` || An identifier for the user's account |
130-
| `userTraits` | `UserTraits OR null` || Additional information about the user |
131-
| `organizationTraits` | `OrganizationTraits OR null` || Additional information about the organization |
132-
| `accountTraits` | `AccountTraits OR null` || Additional information about the account |
133-
134-
<Callout intent="note">
135-
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.
136-
</Callout>
137-
138-
##### User traits
139-
140-
The `UserTraits` class contains detailed information about the user:
141-
142-
<Callout intent="note">
143-
All properties in `UserTraits` are optional.
144-
</Callout>
145-
146-
| Property | Type | Description |
147-
|----------|------|-------------|
148-
| `displayName` | `string OR null` | The displayed name of the user |
149-
| `email` | `string OR null` | The user's email address |
150-
| `fullName` | `string OR null` | The user's full name |
151-
| `description` | `string OR null` | A description of the user |
152-
| `customFields` | `{ [key: string]: any }` | Dictionary of custom fields configured in DevRev |
153-
154-
##### Organization traits
155-
156-
The `OrganizationTraits` class contains detailed information about the organization:
157-
158-
<Callout intent="note">
159-
All properties in `OrganizationTraits` are optional.
160-
</Callout>
161-
162-
| Property | Type | Description |
163-
|----------|------|-------------|
164-
| `displayName` | `string OR null` | The displayed name of the organization |
165-
| `domain` | `string OR null` | The organization's domain |
166-
| `description` | `string OR null` | A description of the organization |
167-
| `phoneNumbers` | `string[] OR null` | Array of the organization's phone numbers |
168-
| `tier` | `string OR null` | The organization's tier or plan level |
169-
| `customFields` | `{ [key: string]: any }` | Dictionary of custom fields configured in DevRev |
170-
171-
##### Account traits
65+
## PLuG support chat
17266

173-
The `AccountTraits` class contains detailed information about the account:
67+
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.
17468

17569
<Callout intent="note">
176-
All properties in `AccountTraits` are optional.
70+
This functionality requires the SDK to be configured and the user to be identified, whether they are unverified or anonymous.
17771
</Callout>
17872

179-
| Property | Type | Description |
180-
|----------|------|-------------|
181-
| `displayName` | `string or null` | The displayed name of the account |
182-
| `domains` | `string[] OR null` | Array of domains associated with the account |
183-
| `description` | `string OR null` | A description of the account |
184-
| `phoneNumbers` | `string[] OR null` | Array of the account's phone numbers |
185-
| `websites` | `string[] OR null` | Array of websites associated with the account |
186-
| `tier` | `string OR null` | The account's tier or plan level |
187-
| `customFields` | `{ [key: string]: any }` | Dictionary of custom fields configured in DevRev |
188-
189-
## PLuG support chat
190-
191-
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.
192-
19373
To show the support chat screen in your app, you can use the following method:
19474

19575
```javascript
@@ -201,7 +81,7 @@ DevRev.showSupport(successCallback, errorCallback)
20181
You can initiate a new support conversation directly from your app. This method displays the support chat screen and simultaneously creates a new conversation.
20282

20383
```javascript
204-
DevRev.createSupportConversation(successCallback, errorCallback)
84+
DevRev.createSupportConversation(isAnimated, successCallback, errorCallback)
20585
```
20686

20787
## In-app link handling
@@ -220,18 +100,14 @@ You can further customize the behavior by setting the `setShouldDismissModalsOnO
220100
DevRev.setShouldDismissModalsOnOpenLink(value, successCallback, errorCallback)
221101
```
222102

223-
## Dynamic theme configuration
224-
225-
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 is dynamic and follows the system appearance.
226-
227-
```javascript
228-
DevRev.setPrefersSystemTheme(value, successCallback, errorCallback)
229-
```
230-
231103
## Analytics
232104

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

107+
<Callout intent="note">
108+
This functionality requires the SDK to be configured and the user to be identified, whether they are unverified or anonymous.
109+
</Callout>
110+
235111
```javascript
236112
DevRev.trackEvent(name, properties, successCallback, errorCallback)
237113
```
@@ -270,7 +146,6 @@ The session recording feature includes the following methods to control the reco
270146
|`DevRev.stopRecording(successCallback, errorCallback)` | Ends the session recording and uploads it to the portal. |
271147
|`DevRev.pauseRecording(successCallback, errorCallback)` | Pauses the ongoing session recording. |
272148
|`DevRev.resumeRecording(successCallback, errorCallback)` | Resumes a paused session recording. |
273-
|`DevRev.processAllOnDemandSessions(successCallback, errorCallback)` | Stops the ongoing user recording and sends all on-demand sessions along with the current recording. |
274149

275150
### Session properties
276151

@@ -280,7 +155,7 @@ You can add custom properties to the session recording to help you understand th
280155
DevRev.addSessionProperties(properties, successCallback, errorCallback)
281156
```
282157

283-
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
158+
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
284159

285160
```javascript
286161
DevRev.clearSessionProperties(successCallback, errorCallback)
@@ -292,14 +167,14 @@ To protect sensitive data, the DevRev SDK provides an auto-masking feature that
292167

293168
While the auto-masking feature may be sufficient for most situations, you can manually mark additional views as sensitive using the following method:
294169

295-
```html
296-
<label class="devrev-mask">Foo: Bar</label>
170+
```javascript
171+
DevRev.markSensitiveViews(tags, successCallback, errorCallback)
297172
```
298173

299174
If any previously masked views need to be unmasked, you can use the following method:
300175

301-
```html
302-
<input type="text" placeholder="Enter Foo" name="foo" required class="devrev-unmask">
176+
```javascript
177+
DevRev.unmarkSensitiveViews(tags, successCallback, errorCallback)
303178
```
304179

305180
### Timers
@@ -325,20 +200,7 @@ DevRev.endTimer(name, properties, successCallback, errorCallback)
325200
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:
326201

327202
```javascript
328-
DevRev.trackScreenName(name, successCallback, errorCallback)
329-
```
330-
331-
### Screen transition management (Android only)
332-
333-
The DevRev SDK allows tracking of screen transitions to understand the user navigation within your app.
334-
You can manually update the state using the following methods:
335-
336-
```javascript
337-
// Mark the transition as started.
338-
DevRev.setInScreenTransitioning(true, successCallback, errorCallback)
339-
340-
// Mark the transition as ended.
341-
DevRev.setInScreenTransitioning(false, successCallback, errorCallback)
203+
DevRev.trackScreenName(screenName, successCallback, errorCallback)
342204
```
343205

344206
## Push notifications
@@ -349,7 +211,7 @@ The DevRev backend sends push notifications to your app to alert users about new
349211

350212
### Configuration
351213

352-
To receive push notifications, you need to configure your DevRev organization by following the instructions in the [push notifications](../push-notifications) section.
214+
To receive push notifications, you need to configure your DevRev organization by following the instructions in the [push notifications](../push-notification) section.
353215

354216
### Register for push notifications
355217

@@ -367,7 +229,7 @@ On Android devices, the `deviceToken` should be the Firebase Cloud Messaging (FC
367229

368230
### Unregister from push notifications
369231

370-
If your app no longer needs to receive push notifications, you can unregister the device.
232+
If your app no longer needs to receive push notifications, you can unregister the device.
371233

372234
Use the following method to unregister the device:
373235

@@ -414,7 +276,7 @@ DevRev.processPushNotification(messageJson, function() {
414276

415277
#### iOS
416278

417-
On iOS devices, you must pass the received push notification payload to the DevRev SDK for processing. The SDK handles the notification and executes the necessary actions.
279+
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.
418280

419281
```javascript
420282
DevRev.processPushNotification(payload, successCallback, errorCallback)

fern/docs/pages/sdks/mobile/cordova/migration-guide.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
This guide and chart should help facilitate the transition from the legacy UserExperior SDK to the new DevRev SDK in your Cordova application, providing insights into feature equivalents and method changes.
44

5-
## Feature equivalence chart
5+
## Feature Equivalence Chart
66

77
| Feature | UserExperior SDK | DevRev SDK |
88
|-|-|-|
9-
| Installation | `cordova plugin add userexperior-cordova-plugin@<VERSION>` | `cordova plugin add @devrev/sdk-cordova` |
9+
| Installation | `cordova plugin add userexperior-cordova-plugin@<version>` | `npm install @devrev/sdk-cordova` |
1010
| Initialization | `UserExperior.startRecording(appID)` | `DevRev.configure(appID, successCallback, errorCallback)` |
11-
| User Identification | `UserExperior.setUserIdentifier(userIdentifier)` | `DevRev.identifyAnonymousUser(userID, successCallback, errorCallback)`<br /> `DevRev.identifyUnverifiedUser(identity, successCallback, errorCallback)`<br /> `DevRev.identifyVerifiedUser(userID, sessionToken, successCallback, errorCallback)`<br /> `DevRev.updateUser(identity, successCallback, errorCallback)`<br /> `DevRev.logout(deviceID, successCallback, errorCallback)` |
11+
| User Identification | `UserExperior.setUserIdentifier(userIdentifier)` | `DevRev.identifyAnonymousUser(userID, successCallback, errorCallback)`<br /> `DevRev.identifyUnverifiedUser(identity, successCallback, errorCallback)`<br /> `DevRev.updateUser(identity, successCallback, errorCallback)`<br /> `DevRev.logout(deviceID, successCallback, errorCallback)` |
1212
| Event Tracking | `UserExperior.logEvent(name)` | `DevRev.trackEvent(name, properties, successCallback, errorCallback)` |
1313
| Session Recording | `UserExperior.stopRecording()`<br />`UserExperior.pauseRecording()`<br />`UserExperior.resumeRecording()` | `DevRev.startRecording(successCallback, errorCallback)`<br />`DevRev.stopRecording(successCallback, errorCallback)`<br />`DevRev.pauseRecording(successCallback, errorCallback)`<br />`DevRev.resumeRecording(successCallback, errorCallback)` |
1414
| Opting-in or out | `UserExperior.optOut()`<br /> `UserExperior.optIn()`<br /> `UserExperior.getOptOutStatus()` | `DevRev.stopAllMonitoring(successCallback, errorCallback)`<br /> `DevRev.resumeAllMonitoring(successCallback, errorCallback)` |
15-
| Session Properties | `UserExperior.setUserProperties(userProperties)` | `DevRev.addSessionProperties(properties, successCallback, errorCallback)`<br />`DevRev.clearSessionProperties(successCallback, errorCallback)` |
15+
| Session Properties | `UserExperior.setUserProperties(userProperties)` | `DevRev.addSessionProperties(properties, successCallback, errorCallback)`<br />`DevRev.clearSessionProperties()` |
1616
| Masking Sensitive Data | `<input type="text" placeholder="Enter Username" name="username" required class="ue-mask">`<br />`<input type="text" placeholder="Enter Username" name="username" required class="ue-unmask">` | `<input type="text" placeholder="Enter Username" name="username" required class="devrev-mask">`<br />`<input type="text" placeholder="Enter Username" name="username" required class="devrev-unmask">` |
17-
| Timers | `UserExperior.startTimer(timerName, properties)`<br /> `UserExperior.endTimer(timerName, properties)` | `DevRev.startTimer(name, properties, successCallback, errorCallback)`<br /> `DevRev.endTimer(name, properties, successCallback, errorCallback)` |
18-
| PLuG support chat | Not supported. | `DevRev.showSupport(successCallback, errorCallback)`<br /> `DevRev.createSupportConversation(successCallback, errorCallback)`<br /> `DevRev.setShouldDismissModalsOnOpenLink(value, successCallback, errorCallback)`<br /> `DevRev.setInAppLinkHandler(handler, successCallback, errorCallback)` |
17+
| Timers | `UserExperior.startTimer(timerName, properties)`<br /> `UserExperior.endTimer(timerName, properties)` | `DevRev.startTimer(name, properties)`<br /> `DevRev.endTimer(name, properties)` |
18+
| PLuG support chat | Not supported. | `DevRev.showSupport(successCallback, errorCallback)`<br /> `DevRev.createSupportConversation(successCallback, errorCallback)`<br /> `DevRev.setShouldDismissModalsOnOpenLink(value, successCallback, errorCallback)`<br /> `DevRevSDK.setInAppLinkHandler(handler, successCallback, errorCallback)` |
1919
| Push Notifications | Not supported. | `DevRev.registerDeviceToken(deviceToken, deviceID, successCallback, errorCallback)`<br /> `DevRev.unregisterDevice(deviceID, successCallback, errorCallback)`<br />`DevRev.processPushNotification(payload, successCallback, errorCallback)` |

0 commit comments

Comments
 (0)