Skip to content

Commit 2d329f4

Browse files
committed
Improve section titles and structure
1 parent 7ec7798 commit 2d329f4

File tree

1 file changed

+79
-14
lines changed

1 file changed

+79
-14
lines changed

fern/docs/pages/plug-sdk/ios.mdx

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
This section describes the process of integrating the DevRev SDK with your iOS app.
22

3-
## Requirements
3+
## Quickstart
4+
### Requirements
45

56
- Xcode 16.0 or higher (latest stable version available on the App Store).
67
- Swift 5.9 or later.
78
- Set the minimum deployment target for your iOS application as iOS 15.
89

9-
## Integration
10+
### Integration
1011

1112
The DevRev SDK can be integrated using either Swift Package Manager (SPM) or CocoaPods.
1213

@@ -21,7 +22,7 @@ To integrate the DevRev SDK into your project using SPM:
2122
1. Open your project in Xcode and navigate to the **Add Package Dependency**.
2223
2. Enter the DevRev SDK URL under **Enter Package URL**:
2324
- For HTTPS: https://github.com/devrev/devrev-sdk-ios
24-
- For SSH: `[email protected]:devrev/devrev-sdk-ios.git`
25+
- For SSH: `[email protected]:devrev/devrev-sdk-ios.git`
2526
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.
2627

2728
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:
3839

3940
This will install the DevRev SDK in your project, making it ready for use.
4041

41-
## Set up the DevRev SDK
42+
### Set up the DevRev SDK
4243

4344
1. Open the DevRev web app at [https://app.devrev.ai](https://app.devrev.ai) and go to the **Settings** page.
4445
2. Under **PLuG settings** copy the value under **Your unique App ID**.
@@ -58,15 +59,20 @@ For example:
5859
DevRev.configure(appID: "abcdefg12345")
5960
```
6061

62+
Use this property to check whether the DevRev SDK has been configured:
63+
```swift
64+
await DevRev.isConfigured
65+
```
66+
6167
- UIKit apps
6268

6369
Configure the SDK in the `AppDelegate.application(_:didFinishLaunchingWithOptions:)` method.
6470

6571
- SwiftUI apps
6672

6773
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
7076

7177
To access certain features of the DevRev SDK, user identification is required.
7278

@@ -100,6 +106,13 @@ DevRev.identifyUnverifiedUser(_:)
100106

101107
The function accepts the `DevRev.Identity` structure, where the user identifier (`userId`) is the only required property; all other properties are optional.
102108

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+
103116
### Update the user
104117

105118
You can update the user's information using the following method:
@@ -120,6 +133,20 @@ The `userID` property cannot be updated.
120133
The identification functions are asynchronous. Ensure you wrap them in a `Task` when calling from synchronous contexts.
121134
</Callout>
122135

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.
149+
123150
For example:
124151

125152
```swift
@@ -133,7 +160,7 @@ await DevRev.identifyUnverifiedUser(Identity(userID: "[email protected]"))
133160
await DevRev.updateUser(Identity(organizationID: "organization-1337"))
134161
```
135162

136-
## PLuG support chat
163+
### PLuG support chat
137164

138165
### UIKit
139166

@@ -175,6 +202,13 @@ To display the support chat screen in a SwiftUI app, you can use the following v
175202
DevRev.supportView
176203
```
177204

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+
178212
#### New conversation closure
179213

180214
You can receive a callback when a new conversation is created by setting the following closure:
@@ -193,7 +227,22 @@ DevRev.conversationCreatedCompletion = { conversationID in
193227
}
194228
```
195229

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
197246

198247
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:
199248

@@ -207,7 +256,7 @@ For example:
207256
await DevRev.trackEvent(name: "open-message-screen", properties: ["id": "message-1337"])
208257
```
209258

210-
## Session analytics
259+
### Session analytics
211260

212261
The DevRev SDK offers session analytics features to help you understand how users interact with your app.
213262

@@ -225,6 +274,11 @@ To opt back in, use the following method:
225274
DevRev.resumeAllMonitoring()
226275
```
227276

277+
You can check whether session monitoring has been enabled by using this property:
278+
```swift
279+
DevRev.isMonitoringEnabled
280+
```
281+
228282
### Session recording
229283

230284
You can enable session recording to capture user interactions with your app.
@@ -241,6 +295,17 @@ The session recording feature includes the following methods to control the reco
241295
|`DevRev.stopRecording()` | Ends the session recording and uploads it to the portal. |
242296
|`DevRev.pauseRecording()` | Pauses the ongoing session recording. |
243297
|`DevRev.resumeRecording()` | Resumes a paused session recording. |
298+
|`DevRev.processAllOnDemandSessions()`| Stops the ongoing user recording and sends all on-demand sessions along with the current recording. |
299+
300+
Using this property will return the status of the session recording:
301+
```swift
302+
DevRev.isRecording
303+
```
304+
305+
To check if on-demand sessions are enabled, use:
306+
```swift
307+
DevRev.areOnDemandSessionsEnabled
308+
```
244309

245310
### Session properties
246311

@@ -250,7 +315,7 @@ You can add custom properties to the session recording to help you understand th
250315
DevRev.addSessionProperties(_:)
251316
```
252317

253-
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
318+
To clear the session properties in scenarios such as user logout or when the session ends, use the following method:
254319

255320
```swift
256321
DevRev.clearSessionProperties()
@@ -411,14 +476,14 @@ func userNotificationCenter(
411476

412477
## Troubleshooting
413478

414-
- **Issue**: Can't import the SDK into my app.
479+
- **Issue**: Can't import the SDK into my app.
415480
**Solution**: Double-check the setup process and ensure that `DevRevSDK` is correctly linked to your application.
416481

417-
- **Issue**: How does the DevRev SDK handle errors?
482+
- **Issue**: How does the DevRev SDK handle errors?
418483
**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`.
419484

420-
- **Issue**: Support chat won't show.
485+
- **Issue**: Support chat won't show.
421486
**Solution**: Ensure you have correctly called one of the identification methods: `DevRev.identifyUnverifiedUser(...)` or `DevRev.identifyAnonymousUser(...)`.
422487

423-
- **Issue**: Not receiving push notifications.
488+
- **Issue**: Not receiving push notifications.
424489
**Solution**: Ensure that your app is configured to receive push notifications and that your device is registered with the DevRev SDK.

0 commit comments

Comments
 (0)