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/sdks/mobile/cordova/features.mdx
+35-30Lines changed: 35 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ To access certain features of the DevRev SDK, user identification is required.
6
6
7
7
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.
8
8
9
-
<Calloutintent="note">
9
+
<Calloutintent="tip">
10
10
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.
11
11
</Callout>
12
12
13
-
<Calloutintent="note">
13
+
<Calloutintent="tip">
14
14
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).
15
15
</Callout>
16
16
@@ -41,25 +41,30 @@ The steps to identify a verified user are as follows:
41
41
2. Exchange your AAT for a session token for each user of your system.
42
42
3. Pass the user identifier and the exchanged session token to the `DevRev.identifyVerifiedUser(_:sessionToken:)` method.
43
43
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
+
<Calloutintent="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>
46
47
47
48
#### Generate an AAT
48
49
49
50
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
50
51
2. Open the **PLuG Tokens** page.
51
52
3. Under the **Application access tokens** panel, click **New token** and copy the token that's displayed.
52
53
53
-
> [!IMPORTANT]
54
-
> Ensure that you copy the generated application access token, as you cannot view it again.
54
+
<Calloutintent="warning">
55
+
Ensure that you copy the generated application access token, as you cannot view it again.
56
+
</Callout>
55
57
56
58
#### Exchange your AAT for a session token
57
59
58
60
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.
59
61
60
62
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
+
<Calloutintent="warning">
65
+
Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
The response of the API call will contain a session token that you can use with the verified identification method in your app.
77
82
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
+
<Calloutintent="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>
80
86
81
87
#### Identifying the verified user
82
88
@@ -94,7 +100,7 @@ You can update the user's information using the following method:
@@ -123,15 +129,18 @@ The `Identity` class contains the following properties:
123
129
|`organizationTraits`|`OrganizationTraits OR null`| ❌ | Additional information about the organization |
124
130
|`accountTraits`|`AccountTraits OR null`| ❌ | Additional information about the account |
125
131
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
+
<Calloutintent="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>
128
135
129
136
##### UserTraits
130
137
131
138
The `UserTraits` class contains detailed information about the user:
132
139
133
-
> [!NOTE]
134
-
> All properties in `UserTraits` are optional.
140
+
<Calloutintent="note">
141
+
All properties in `UserTraits` are optional.
142
+
</Callout>
143
+
135
144
| Property | Type | Description |
136
145
|----------|------|-------------|
137
146
|`displayName`|`string OR null`| The displayed name of the user |
@@ -144,8 +153,10 @@ The `UserTraits` class contains detailed information about the user:
144
153
145
154
The `OrganizationTraits` class contains detailed information about the organization:
146
155
147
-
> [!NOTE]
148
-
> All properties in `OrganizationTraits` are optional.
156
+
<Calloutintent="note">
157
+
All properties in `OrganizationTraits` are optional.
158
+
</Callout>
159
+
149
160
| Property | Type | Description |
150
161
|----------|------|-------------|
151
162
|`displayName`|`string OR null`| The displayed name of the organization |
@@ -159,8 +170,10 @@ The `OrganizationTraits` class contains detailed information about the organizat
159
170
160
171
The `AccountTraits` class contains detailed information about the account:
161
172
162
-
> [!NOTE]
163
-
> All properties in `AccountTraits` are optional.
173
+
<Calloutintent="note">
174
+
All properties in `AccountTraits` are optional.
175
+
</Callout>
176
+
164
177
| Property | Type | Description |
165
178
|----------|------|-------------|
166
179
|`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
177
190
178
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.
179
192
180
-
<Calloutintent="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
-
184
193
To show the support chat screen in your app, you can use the following method:
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.
0 commit comments