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/ios/features.mdx
+39-25Lines changed: 39 additions & 25 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
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
@@ -43,25 +43,30 @@ The steps to identify a verified user are as follows:
43
43
2. Exchange your AAT for a session token for each user of your system.
44
44
3. Pass the user identifier and the exchanged session token to the `DevRev.identifyVerifiedUser(_:sessionToken:)` method.
45
45
46
-
> [!CAUTION]
47
-
> For security reasons we **strongly recommend** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
46
+
<Calloutintent="warning">
47
+
For security reasons we **strongly recommend** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
48
+
</Callout>
48
49
49
50
#### Generate an AAT
50
51
51
52
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
52
53
2. Open the **PLuG Tokens** page.
53
54
3. Under the **Application access tokens** panel, click **New token** and copy the token that's displayed.
54
55
55
-
> [!IMPORTANT]
56
-
> Ensure that you copy the generated application access token, as you cannot view it again.
56
+
<Calloutintent="warning">
57
+
Ensure that you copy the generated application access token, as you cannot view it again.
58
+
</Callout>
57
59
58
60
#### Exchange your AAT for a session token
59
61
60
62
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.
61
63
62
64
Here is a simple example of an API request to the DevRev backend to exchange your AAT for a session token:
63
-
> [!CAUTION]
64
-
> Make sure that you replace the `<AAT>` and `<YOUR_USER_ID>` with the actual values.
65
+
66
+
<Calloutintent="warning">
67
+
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.
79
84
80
-
> [!NOTE]
81
-
> 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
+
<Calloutintent="warning">
86
+
As a good practice, **your** app should retrieve the exchanged session token from **your** backend at app launch or any relevant app lifecycle event.
87
+
</Callout>
82
88
83
89
#### Identifying the verified user
84
90
@@ -100,11 +106,11 @@ DevRev.updateUser(_:)
100
106
101
107
This function accepts the `DevRev.Identity` structure.
102
108
103
-
<Calloutintent="note">
109
+
<Calloutintent="warning">
104
110
The `userID` property cannot be updated.
105
111
</Callout>
106
112
107
-
<Calloutintent="note">
113
+
<Calloutintent="tip">
108
114
The identification functions are asynchronous. Ensure you wrap them in a `Task` when calling from synchronous contexts.
109
115
</Callout>
110
116
@@ -160,14 +166,18 @@ The `Identity` class contains the following properties:
160
166
|`organizationTraits`|`OrganizationTraits?`| ❌ | Additional information about the organization |
161
167
|`accountTraits`|`AccountTraits?`| ❌ | Additional information about the account |
162
168
163
-
> [!NOTE]
164
-
> 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.
169
+
<Calloutintent="note">
170
+
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.
171
+
</Callout>
172
+
165
173
##### UserTraits
166
174
167
175
The `UserTraits` class contains detailed information about the user:
168
176
169
-
> [!NOTE]
170
-
> All properties in `UserTraits` are optional.
177
+
<Calloutintent="note">
178
+
All properties in `UserTraits` are optional.
179
+
</Callout>
180
+
171
181
| Property | Type | Description |
172
182
|----------|------|-------------|
173
183
|`displayName`|`String?`| The displayed name of the user |
@@ -181,8 +191,10 @@ The `UserTraits` class contains detailed information about the user:
181
191
182
192
The `OrganizationTraits` class contains detailed information about the organization:
183
193
184
-
> [!NOTE]
185
-
> All properties in `OrganizationTraits` are optional.
194
+
<Calloutintent="note">
195
+
All properties in `OrganizationTraits` are optional.
196
+
</Callout>
197
+
186
198
| Property | Type | Description |
187
199
|----------|------|-------------|
188
200
|`displayName`|`String?`| The displayed name of the organization |
@@ -196,8 +208,10 @@ The `OrganizationTraits` class contains detailed information about the organizat
196
208
197
209
The `AccountTraits` class contains detailed information about the account:
198
210
199
-
> [!NOTE]
200
-
> All properties in `AccountTraits` are optional.
211
+
<Calloutintent="note">
212
+
All properties in `AccountTraits` are optional.
213
+
</Callout>
214
+
201
215
| Property | Type | Description |
202
216
|----------|------|-------------|
203
217
|`displayName`|`String?`| The displayed name of the account |
@@ -329,7 +343,7 @@ DevRev.resumeAllMonitoring()
329
343
You can enable session recording to capture user interactions with your app.
330
344
331
345
<Calloutintent="note">
332
-
The session recording feature is opt-in and is enabled by default.
346
+
The session recording feature is opt-out and is enabled by default.
333
347
</Callout>
334
348
335
349
The session recording feature includes the following methods to control the recording:
@@ -349,7 +363,7 @@ You can add custom properties to the session recording to help you understand th
349
363
DevRev.addSessionProperties(_:)
350
364
```
351
365
352
-
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
366
+
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
353
367
354
368
```swift
355
369
DevRev.clearSessionProperties()
@@ -402,7 +416,7 @@ class MyMaskingProvider: NSObject, DevRev.MaskLocationProviding {
Setting a new provider overrides any previously set masking location provider.
407
421
</Callout>
408
422
@@ -462,7 +476,7 @@ You need to ensure that your iOS app is configured to receive push notifications
462
476
463
477
### Register for push notifications
464
478
465
-
<Calloutintent="note">
479
+
<Calloutintent="tip">
466
480
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.
467
481
</Callout>
468
482
@@ -532,7 +546,7 @@ Push notifications coming to the DevRev SDK need to be handled manually. To prop
532
546
DevRev.processPushNotification(_:)
533
547
```
534
548
535
-
<Calloutintent="note">
549
+
<Calloutintent="tip">
536
550
For convenience, this method provides two overloads that accept `userInfo` as either `[AnyHashable: Any]` or `[String: any Sendable]` dictionary types.
3. In the **Build Phases** section of your app target, locate the **Link Binary With Libraries** phase and confirm that `DevRevSDK` is linked. If not, add it by clicking **+** and selecting `DevRevSDK` from the list.
18
18
19
19
Now you should be able to import and use the DevRev SDK in your project.
@@ -36,7 +36,7 @@ This will install the DevRev SDK in your project, making it ready for use.
36
36
2. Under **PLuG settings** copy the value under **Your unique App ID**.
37
37
3. After obtaining the credentials, you can configure the DevRev SDK in your app.
38
38
39
-
<Calloutintent="note">
39
+
<Calloutintent="warning">
40
40
The DevRev SDK must be configured before you can use any of its features.
0 commit comments