Skip to content

Commit 799e214

Browse files
committed
Release 0.9.2
1 parent d18fc04 commit 799e214

File tree

83 files changed

+276
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+276
-82
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Added
2-
- Initial release of the DevRev SDK.
3-
- Added the PLuG support chat feature.
4-
- Added user identification.
2+
- Added support for tracking analytics events.
3+
4+
# Changed
5+
- Updated the initial configuration method.
6+
- Updated the support widget to version 2.0.
7+
8+
# Deprecated
9+
- Removed the organization slug (`organizationSlug`) parameter from the configuration method.
510

611
For installation instructions, consult the [documentation](README.md).

DevRevSDK.xcframework.zip

604 KB
Binary file not shown.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ let package = Package(
1818
targets: [
1919
.binaryTarget(
2020
name: "DevRevSDK",
21-
url: "https://github.com/devrev/devrev-sdk-ios/releases/download/v0.9.1/DevRevSDK.xcframework.zip",
22-
checksum: "24f0fdf4f70bcdf90c235b8ecead03aff31da3dbe1ba17391f1d97a1e3dd7c5b"
21+
url: "https://github.com/devrev/devrev-sdk-ios/releases/download/v0.9.2/DevRevSDK.xcframework.zip",
22+
checksum: "3f28597cb0fc2ea725e67a6ae14488ab15c9574dea6fb605e633b0b8982e27cb"
2323
)
2424
]
2525
)

README.md

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@
55
- [Setting up the DevRev SDK](#setting-up-the-devrev-sdk)
66
- [Step 1: Credentials](#step-1-credentials)
77
- [Step 2: Initialization](#step-2-initialization)
8+
- [Example](#example)
89
- [UIKit apps](#uikit-apps)
910
- [SwiftUI apps](#swiftui-apps)
1011
- [Features](#features)
1112
- [Identification](#identification)
13+
- [Example](#example-1)
1214
- [PLuG support chat](#plug-support-chat)
1315
- [UIKit](#uikit)
16+
- [Example](#example-2)
1417
- [SwiftUI](#swiftui)
15-
- [Example](#example)
18+
- [New conversation callback](#new-conversation-callback)
19+
- [Example](#example-3)
20+
- [Analytics](#analytics)
21+
- [Example](#example-4)
22+
- [Screenshots](#screenshots)
1623
- [Sample app](#sample-app)
1724
- [Troubleshooting](#troubleshooting)
1825
- [Cannot import the SDK into my app](#cannot-import-the-sdk-into-my-app)
@@ -25,7 +32,6 @@
2532
- Minimum deployment target iOS 15.
2633

2734
# Setup
28-
2935
You can integrate the DevRev SDK in your project as a Swift Package Manager (SPM) package.
3036

3137
Open your project in Xcode, go to the `Add Package` screen, add the following URL under `Enter Package URL`:
@@ -39,49 +45,55 @@ Now you should be able to import and use the DevRev SDK.
3945

4046
# Setting up the DevRev SDK
4147
## Step 1: Credentials
42-
Open the **Support** settings page, then go to **PLuG Setup**.
43-
44-
<img src="docs/screenshots/screenshot-support-settings.png" width="250" />
45-
46-
On the **PLuG Setup** page, you will be able to create your SDK credentials (app ID and secret).
47-
48-
<img src="docs/screenshots/screenshot-creating-credentials.png" width="400" />
49-
48+
1. Open the **Settings** page.
49+
<img src="docs/screenshots/screenshot-settings-home.png" />
50+
1. Under the **Support** section, go to **PLuG Tokens**.
51+
<img src="docs/screenshots/screenshot-support-tokens.png" width="250" />
52+
1. On the **PLuG Tokens** page, you will be able create your credentials under the **App Credentials**. These credentials are referred to as `appID` and `secret` in the code.
53+
- Create new credentials, if none exist:
54+
<img src="docs/screenshots/screenshot-support-tokens-creating-credentials.png" width="400" />
55+
- Or maybe reuse any existing ones:
56+
<img src="docs/screenshots/screenshot-support-tokens-existing-credentials.png" width="400" />
57+
1. Next, you will have to open the **PLuG Settings** page, and copy the value under **Your Unique App ID**.
58+
> This value is referred to as `supportID` in the code.
59+
<img src="docs/screenshots/screenshot-support-settings.png" width="250" />
60+
<img src="docs/screenshots/screenshot-support-settings-id.png" width="400" />
5061

5162
## Step 2: Initialization
52-
5363
Once you have the credentials, you can configure the DevRev SDK in your app. The SDK will be initialized once you have called the configuration method:
5464

5565
```swift
56-
DevRev.configure(appID: appID, secret: secret, organizationSlug: organizationSlug)
66+
DevRev.configure(appID:secret:supportID:)
5767
```
5868

59-
### UIKit apps
69+
#### Example
70+
```swift
71+
DevRev.configure(appID: appID, secret: secret, supportID: supportID)
72+
```
6073

74+
### UIKit apps
6175
Configure the SDK in the `AppDelegate.application(_:didFinishLaunchingWithOptions:)` method.
6276

6377
### SwiftUI apps
64-
6578
Depending on the architecture of your app, you will need to configure the SDK at your entry point or initial view of the app.
6679

6780
# Features
68-
6981
## Identification
70-
Certain features of the SDK **require** a user identification. Make sure that you identify the user using the `DevRev.identify(...)` function.
82+
Certain features of the SDK **require** a user identification. Make sure that you identify the user using the `DevRev.identify(_:)` function.
7183

7284
The function accepts the `DevRev.Identification` structure, with the user ID (`userID`) as the only required property, all other properties are optional.
7385

74-
The call would look something like this:
86+
> Note: The `DevRev.identify(_:)` function is an asynchronous one, make sure that you wrap it in a `Task` when calling it from synchronous contexts.
87+
88+
#### Example
7589
```swift
7690
await DevRev.identify(Identification(userID: "[email protected]"))
7791
```
7892

79-
The identification function should be placed at the appropriate place in your app after you login your user. If you have the user information at app launch, call the function after the `DevRev.configure(...)` method.
93+
The identification function should be placed at the appropriate place in your app after you login your user. If you have the user information at app launch, call the function after the `DevRev.configure(appID:secret:supportID:)` method.
8094

8195
## PLuG support chat
82-
8396
### UIKit
84-
8597
The support chat feature can be shown as a modal screen or pushed to a navigation stack.
8698

8799
The following overloaded method will show the support screen:
@@ -92,16 +104,46 @@ DevRev.showSupport(from:isAnimated:)
92104
1. If a `UIViewController` is passed as the `from` parameter, then the screen will be shown **modally**.
93105
1. If a `UINavigationController` is passed as the `from` parameter, then the screen will be pushed onto the stack.
94106

95-
### SwiftUI
107+
#### Example
108+
```swift
109+
DevRev.showSupport(from: mainViewController)
110+
```
96111

112+
### SwiftUI
97113
For SwiftUI apps we provide a specific view, you just need to use the public view property:
98114

99115
```swift
100116
DevRev.supportView
101117
```
102118

103-
### Example
119+
### New conversation callback
120+
For convenience, a callback closure has been added, that way the host app will be able to access the conversation ID.
121+
122+
```swift
123+
DevRev.conversationCreatedCompletion
124+
```
125+
126+
#### Example
127+
```swift
128+
DevRev.conversationCreatedCompletion = { conversationID in
129+
print("A new conversation has been created: \(conversationID).")
130+
}
131+
```
132+
133+
## Analytics
134+
The DevRev SDK supports sending custom analytic events using a name and a string dictionary.
135+
136+
You can track them using the following function:
137+
```swift
138+
DevRev.trackEvent(name:properties:)
139+
```
140+
141+
#### Example
142+
```swift
143+
DevRev.trackEvent(name: "open-message-screen", properties: ["id": "foo-bar-1337"])
144+
```
104145

146+
### Screenshots
105147
<img src="docs/screenshots/screenshot-sample-identifying-the-user.png" width="250" />
106148
<br />
107149
<img src="docs/screenshots/screenshot-sample-identified-user.png" width="250" />
@@ -120,10 +162,9 @@ Before you start using the sample app you will need to configure it to be used w
120162
- Select the appropriate target (2),
121163
- Go to the Signing & Capabilities section (3), and
122164
- Select your development team under Team (4).
123-
<img src="docs/screenshots/screenshot-sample-signing.png" />
165+
<img src="docs/screenshots/screenshot-xcode-signing.png" width="400" />
124166

125167
# Troubleshooting
126-
127168
## Cannot import the SDK into my app
128169
Check the [Setup](#setup) again and make sure that DevRevSDK is properly linked.
129170

Samples/SampleSwiftUI/ContentView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ struct ContentView: View {
77
@State private var userID: String = ""
88

99
#error("The sample app needs a development team set for code signing.")
10-
#error("Enter your credentials and organization slug here!")
10+
#error("Enter your credentials and support ID here!")
1111
private let appID = "<APPID>"
1212
private let secret = "<SECRET>"
13-
private let organizationSlug = "<SLUG>"
13+
private let supportID = "<SUPPORT_ID>"
1414

1515
init() {
1616
DevRev.configure(appID: appID,
1717
secret: secret,
18-
organizationSlug: organizationSlug)
18+
supportID: supportID)
1919
}
2020

2121
var body: some View {

Samples/SampleUIKit/AppDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import DevRevSDK
44
@main
55
class AppDelegate: UIResponder, UIApplicationDelegate {
66
#error("The sample app needs a development team set for code signing.")
7-
#error("Enter your credentials and organization slug here!")
7+
#error("Enter your credentials and support ID here!")
88
private let appID = "<APPID>"
99
private let secret = "<SECRET>"
10-
private let organizationSlug = "<SLUG>"
10+
private let supportID = "<SUPPORT_ID>"
1111

1212
func application(_ application: UIApplication,
1313
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1414
DevRev.configure(appID: appID,
1515
secret: secret,
16-
organizationSlug: organizationSlug)
16+
supportID: supportID)
1717

1818
return true
1919
}

docs/css/chunk-384ef189.7ede1ea3.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/css/documentation-topic.29351f99.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/css/documentation-topic~topic.fccbd76c.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/css/documentation-topic~topic~tutorials-overview.1099452b.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)