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
- Xcode 16.0 or higher (latest stable version available on the App Store)
58
-
- Swift 5.9 or later
59
-
- Set the minimum deployment target for your iOS application as iOS 15
67
+
- Xcode 16.0 or later (latest stable version available on the App Store).
68
+
- Swift 5.9 or later.
69
+
- Set the minimum deployment target for your iOS application as iOS 15.
60
70
61
71
### Integration
62
-
63
72
The DevRev SDK can be integrated using either Swift Package Manager (SPM) or CocoaPods.
64
73
65
74
> [!CAUTION]
66
75
> We recommend integrating the DevRev SDK using Swift Package Manager. CocoaPods is in [maintenance mode](https://blog.cocoapods.org/CocoaPods-Support-Plans/) since August 2024 and will be [deprecated in the future](https://blog.cocoapods.org/CocoaPods-Specs-Repo/).
67
76
68
77
#### Swift Package Manager (Recommended)
69
-
70
78
You can integrate the DevRev SDK in your project as a Swift Package Manager (SPM) package.
71
79
72
80
To integrate the DevRev SDK into your project using SPM:
@@ -80,7 +88,6 @@ To integrate the DevRev SDK into your project using SPM:
80
88
Now you should be able to import and use the DevRev SDK in your project.
81
89
82
90
#### CocoaPods
83
-
84
91
To integrate the DevRev SDK using CocoaPods:
85
92
86
93
1. Add the following to your `Podfile`:
@@ -93,7 +100,6 @@ To integrate the DevRev SDK using CocoaPods:
93
100
This will install the DevRev SDK in your project, making it ready for use.
94
101
95
102
### Set up the DevRev SDK
96
-
97
103
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
98
104
2. Under **PLuG settings** copy the value under **Your unique App ID**.
99
105
3. After obtaining the credentials, you can configure the DevRev SDK in your app.
@@ -126,7 +132,6 @@ To access certain features of the DevRev SDK, user identification is required.
126
132
127
133
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.
128
134
129
-
130
135
> [!IMPORTANT]
131
136
> 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.
The function accepts the `DevRev.Identity` structure, with the user identifier (`userID`) as the only required property, all other properties are optional.
151
156
152
157
#### Verified identification
153
-
The verified identification method is used to identify the user with a unique identifier and verify the user's identity with the DevRev backend.
158
+
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.
159
+
160
+
The steps to identify a verified user are as follows:
161
+
1. Generate an AAT for your system (preferably through your backend).
162
+
2. Exchange your AAT for a session token for each user of your system.
163
+
3. Pass the user identifier and the exchanged session token to the `DevRev.identifyVerifiedUser(_:sessionToken:)` method.
164
+
165
+
> [!CAUTION]
166
+
> For security reasons we **strongly recommend** that the token exchange is executed on your backend to prevent exposing your application access token (AAT).
167
+
168
+
##### Generate an AAT
169
+
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
170
+
2. Open the **PLuG Tokens** page.
171
+
3. Under the **Application access tokens** panel, click **New token** and copy the token that's displayed.
172
+
173
+
> [!IMPORTANT]
174
+
> Ensure that you copy the generated application access token, as you cannot view it again.
175
+
176
+
##### Exchange your AAT for a session token
177
+
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.
178
+
179
+
Here is a simple example of an API request to the DevRev backend to exchange your AAT for a session token:
180
+
> [!CAUTION]
181
+
> 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.
154
196
197
+
> [!NOTE]
198
+
> As a good practice, **your** app should retrieve the exchanged session token from **your** backend at app launch or any relevant app lifecycle event.
199
+
200
+
##### Identifying the verified user
201
+
Pass the user identifier and the exchanged session token to the verified identification method:
The `Identity` class 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.
252
+
253
+
##### Properties
254
+
The `Identity` class contains the following properties:
255
+
256
+
| Property | Type | Required | Description |
257
+
|----------|------|----------|-------------|
258
+
|`userID`|`String`| ✅ | A unique identifier for the user |
259
+
|`organizationID`|`String?`| ❌ | An identifier for the user's organization |
260
+
|`accountID`|`String?`| ❌ | An identifier for the user's account |
261
+
|`userTraits`|`UserTraits?`| ❌ | Additional information about the user |
262
+
|`organizationTraits`|`OrganizationTraits?`| ❌ | Additional information about the organization |
263
+
|`accountTraits`|`AccountTraits?`| ❌ | Additional information about the account |
264
+
265
+
> [!NOTE]
266
+
> 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.
267
+
268
+
###### UserTraits
269
+
The `UserTraits` class contains detailed information about the user:
270
+
271
+
> [!NOTE]
272
+
> All properties in `UserTraits` are optional.
273
+
274
+
| Property | Type | Description |
275
+
|----------|------|-------------|
276
+
|`displayName`|`String?`| The displayed name of the user |
277
+
|`email`|`String?`| The user's email address |
278
+
|`fullName`|`String?`| The user's full name |
279
+
|`userDescription`|`String?`| A description of the user |
280
+
|`phoneNumbers`|`[String]?`| Array of the user's phone numbers |
281
+
|`customFields`|`[String: Any]?`| Dictionary of custom fields configured in DevRev |
282
+
283
+
###### OrganizationTraits
284
+
The `OrganizationTraits` class contains detailed information about the organization:
285
+
286
+
> [!NOTE]
287
+
> All properties in `OrganizationTraits` are optional.
288
+
289
+
| Property | Type | Description |
290
+
|----------|------|-------------|
291
+
|`displayName`|`String?`| The displayed name of the organization |
292
+
|`domain`|`String?`| The organization's domain |
293
+
|`organizationDescription`|`String?`| A description of the organization |
294
+
|`phoneNumbers`|`[String]?`| Array of the organization's phone numbers |
295
+
|`tier`|`String?`| The organization's tier or plan level |
296
+
|`customFields`|`[String: Any]?`| Dictionary of custom fields configured in DevRev |
297
+
298
+
###### AccountTraits
299
+
The `AccountTraits` class contains detailed information about the account:
300
+
301
+
> [!NOTE]
302
+
> All properties in `AccountTraits` are optional.
303
+
304
+
| Property | Type | Description |
305
+
|----------|------|-------------|
306
+
|`displayName`|`String?`| The displayed name of the account |
307
+
|`domains`|`[String]?`| Array of domains associated with the account |
308
+
|`accountDescription`|`String?`| A description of the account |
309
+
|`phoneNumbers`|`[String]?`| Array of the account's phone numbers |
310
+
|`websites`|`[String]?`| Array of websites associated with the account |
311
+
|`tier`|`String?`| The account's tier or plan level |
312
+
|`customFields`|`[String: Any]?`| Dictionary of custom fields configured in DevRev |
313
+
203
314
### PLuG support chat
204
315
#### UIKit
205
316
The support chat feature can be shown as a modal screen from a specific view controller or the top-most one, or can be pushed onto a navigation stack.
@@ -369,6 +480,40 @@ If any previously masked views need to be unmasked, you can use the following me
369
480
DevRev.unmarkSensitiveViews(_:)
370
481
```
371
482
483
+
#### Custom masking provider
484
+
For advanced use cases, you can provide a custom masking provider to specify exactly which regions of the UI should be masked in snapshots.
485
+
486
+
You can implement your own masking logic by conforming to the `DevRev.MaskLocationProviding` protocol and setting your custom object as the masking provider. This allows you to specify explicit regions to be masked or to skip snapshots entirely.
487
+
488
+
-`DevRev.setMaskingLocationProvider(_ provider: DevRev.MaskLocationProviding)`: Sets the external view masking provider used to determine which areas of the UI should be masked for privacy during snapshots. The provider must conform to the `DevRev.MaskLocationProviding` protocol.
489
+
-`DevRev.MaskLocationProviding`: Protocol for providing explicit masking locations for UI snapshots.
490
+
-`DevRev.SnapshotMask`: Describes the regions of a snapshot to be masked.
491
+
-`DevRev.SnapshotMask.Location`: Describes a masked region.
> Setting a new provider will override any previously set masking location provider.
516
+
372
517
#### Timers
373
518
The DevRev SDK offers a timer mechanism to measure the time spent on specific tasks, allowing you to track events such as response time, loading time, or any other duration-based metrics.
0 commit comments