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
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.
26
27
27
28
Now you should be able to import and use the DevRev SDK in your project.
@@ -38,7 +39,7 @@ To integrate the DevRev SDK using CocoaPods:
38
39
39
40
This will install the DevRev SDK in your project, making it ready for use.
40
41
41
-
## Set up the DevRev SDK
42
+
###Set up the DevRev SDK
42
43
43
44
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
44
45
2. Under **PLuG settings** copy the value under **Your unique App ID**.
@@ -58,15 +59,20 @@ For example:
58
59
DevRev.configure(appID: "abcdefg12345")
59
60
```
60
61
62
+
Use this property to check whether the DevRev SDK has been configured:
63
+
```swift
64
+
await DevRev.isConfigured
65
+
```
66
+
61
67
- UIKit apps
62
68
63
69
Configure the SDK in the `AppDelegate.application(_:didFinishLaunchingWithOptions:)` method.
64
70
65
71
- SwiftUI apps
66
72
67
73
Depending on your app's architecture, configure the SDK at the app's entry point or initial view.
68
-
69
-
## Identification
74
+
## Features
75
+
###Identification
70
76
71
77
To access certain features of the DevRev SDK, user identification is required.
The function accepts the `DevRev.Identity` structure, where the user identifier (`userId`) is the only required property; all other properties are optional.
102
108
109
+
#### Verified identification
110
+
The verified identification method is used to identify the user with a unique identifier and verify the user's identity with the DevRev backend.
111
+
112
+
```swift
113
+
DevRev.identifyVerifiedUser(_:sessionToken:)
114
+
```
115
+
103
116
### Update the user
104
117
105
118
You can update the user's information using the following method:
@@ -120,6 +133,20 @@ The `userID` property cannot be updated.
120
133
The identification functions are asynchronous. Ensure you wrap them in a `Task` when calling from synchronous contexts.
121
134
</Callout>
122
135
136
+
Use this property to check whether the user is identified in the current session:
137
+
```swift
138
+
await DevRev.isUserIdentified
139
+
```
140
+
141
+
### Logout
142
+
You can perform a logout of the current user by calling the following method:
143
+
144
+
```swift
145
+
DevRev.logout(deviceID:)
146
+
```
147
+
148
+
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.
@@ -175,6 +202,13 @@ To display the support chat screen in a SwiftUI app, you can use the following v
175
202
DevRev.supportView
176
203
```
177
204
205
+
#### Creating a new conversation
206
+
You have the ability to create a new conversation from within your app. The method will show the support chat screen and create a new conversation at the same time.
207
+
208
+
```swift
209
+
DevRev.createSupportConversation()
210
+
```
211
+
178
212
#### New conversation closure
179
213
180
214
You can receive a callback when a new conversation is created by setting the following closure:
@@ -193,7 +227,22 @@ DevRev.conversationCreatedCompletion = { conversationID in
193
227
}
194
228
```
195
229
196
-
## Analytics
230
+
### In-app link handling
231
+
The DevRev SDK provides a mechanism to handle links opened from within any screen that is part of the DevRev SDK.
232
+
233
+
You can fully customize the link handling behavior by setting the specialized in-app link handler. That way you can decide what should happen when a link is opened from within the app.
234
+
235
+
```swift
236
+
DevRev.inAppLinkHandler: ((URL) ->Void)?
237
+
```
238
+
239
+
You can further customize the behavior by setting the `shouldDismissModalsOnOpenLink` boolean flag. This flag controls whether the DevRev SDK should dismiss the top-most modal screen when a link is opened.
240
+
241
+
```swift
242
+
DevRev.shouldDismissModalsOnOpenLink:Bool
243
+
```
244
+
245
+
### Analytics
197
246
198
247
The DevRev SDK allows you to send custom analytic events by using a name and a string dictionary. You can track these events using the following function:
**Solution**: Double-check the setup process and ensure that `DevRevSDK` is correctly linked to your application.
416
481
417
-
-**Issue**: How does the DevRev SDK handle errors?
482
+
-**Issue**: How does the DevRev SDK handle errors?
418
483
**Solution**: The DevRev SDK reports all errors in the console using Apple's Unified Logging System. Look for error messages in the subsystem `ai.devrev.sdk`.
419
484
420
-
-**Issue**: Support chat won't show.
485
+
-**Issue**: Support chat won't show.
421
486
**Solution**: Ensure you have correctly called one of the identification methods: `DevRev.identifyUnverifiedUser(...)` or `DevRev.identifyAnonymousUser(...)`.
422
487
423
-
-**Issue**: Not receiving push notifications.
488
+
-**Issue**: Not receiving push notifications.
424
489
**Solution**: Ensure that your app is configured to receive push notifications and that your device is registered with the DevRev SDK.
0 commit comments