Skip to content

Commit e1a571c

Browse files
committed
Release 1.0.3
1 parent 3a22d4c commit e1a571c

File tree

168 files changed

+581
-334
lines changed

Some content is hidden

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

168 files changed

+581
-334
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.3] - 2025-02-03
9+
10+
### Fixed
11+
- Fixed an issue where an already identified user could not be switched with a new user of the same type.
12+
13+
### Deprecated
14+
- This version drops support for iOS versions below 15.
15+
816
## [1.0.2] - 2025-01-13
917

1018
### Fixed

DevRevSDK.doccarchive.zip

110 Bytes
Binary file not shown.

DevRevSDK.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Pod::Spec.new do |spec|
22
spec.name = "DevRevSDK"
3-
spec.version = "1.0.2"
3+
spec.version = "1.0.3"
44
spec.summary = "DevRev SDK, used for integrating DevRev services into your iOS app."
55
spec.homepage = "https://devrev.ai"
66
spec.license = "Apache 2.0"
77
spec.author = { "DevRev" => "[email protected]" }
8-
spec.platform = :ios, "13.0"
8+
spec.platform = :ios, "15.0"
99
spec.source = {
10-
http: "https://github.com/devrev/devrev-sdk-ios/releases/download/v1.0.2/DevRevSDK.xcframework.zip",
10+
http: "https://github.com/devrev/devrev-sdk-ios/releases/download/v1.0.3/DevRevSDK.xcframework.zip",
1111
type: :zip,
1212
headers: [
1313
"Accept: application/octet-stream",

DevRevSDK.xcframework.zip

-29.2 KB
Binary file not shown.

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageDescription
55
let package = Package(
66
name: "DevRevSDK",
77
platforms: [
8-
.iOS(.v13)
8+
.iOS(.v15)
99
],
1010
products: [
1111
.library(
@@ -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/v1.0.2/DevRevSDK.xcframework.zip",
22-
checksum: "402aa01a6094dc562992ecaf4e23cd63d827d5a5258fee7a810c7054cf31c353"
21+
url: "https://github.com/devrev/devrev-sdk-ios/releases/download/v1.0.3/DevRevSDK.xcframework.zip",
22+
checksum: "9aac35d9bb90cd6ef32be7ef034476c7b36b32383b141237ab38d60e4a4fde51"
2323
)
2424
]
2525
)

README.md

Lines changed: 97 additions & 115 deletions
Large diffs are not rendered by default.

Samples/.DS_Store

0 Bytes
Binary file not shown.

Samples/SampleSwiftUI/.DS_Store

2 KB
Binary file not shown.

Samples/SampleSwiftUI/AppDelegate.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,23 @@ import DevRevSDK
55
class AppDelegate: NSObject, UIApplicationDelegate {
66
// MARK: - Configuration
77

8-
#error("The sample app needs a development team set for code signing.")
9-
#error("Enter your credentials here!")
10-
private let appID = "<APPID>"
8+
#warning("The sample app needs a development team set for code signing.")
9+
#warning("Enter your credentials here!")
10+
private let appID = "DvRvStPZG9uOmNvcmU6ZHZydi11cy0xOmRldm8vM2ZBSEVDOnBsdWdfc2V0dGluZy8xX198fF9fMjAyNC0wNy0yOSAwOTozMjoxNC4xNjU1Mjc4NTggKzAwMDAgVVRDxlxendsDvRv"
11+
private let testOrganizer = UITestOrganizer()
1112

1213
// MARK: - App lifecycle
1314

1415
func application(
1516
_ application: UIApplication,
1617
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
1718
) -> Bool {
19+
guard
20+
let appID = testOrganizer.isInTestMode ? testOrganizer.appID : appID
21+
else {
22+
fatalError("Missing app ID for testing")
23+
}
24+
1825
DevRev.configure(appID: appID)
1926

2027
Task { @MainActor in

Samples/SampleSwiftUI/ContentView.swift

Lines changed: 33 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,47 @@ import SwiftUI
33
import DevRevSDK
44

55
struct ContentView: View {
6-
@SwiftUI.State private var isSupportVisible = false
6+
@SwiftUI.State private var isUserConfigured = true
77
@SwiftUI.State private var isUserIdentified = false
8-
@SwiftUI.State private var userID: String = ""
9-
8+
109
var body: some View {
11-
VStack {
12-
TextField("User ID", text: $userID)
13-
.padding()
14-
.textFieldStyle(RoundedBorderTextFieldStyle())
15-
.autocorrectionDisabled()
16-
.autocapitalization(.none)
17-
18-
Button("Identify the unverified user") {
19-
Task {
20-
await DevRev.identifyUnverifiedUser(Identity(userID: userID))
21-
22-
isUserIdentified = await DevRev.isUserIdentified
10+
NavigationView {
11+
List {
12+
HStack{
13+
Image(systemName: isUserConfigured ? "checkmark.square.fill" : "square")
14+
Text("Configured")
2315
}
24-
}
25-
.disabled(userID.isEmpty)
26-
.modifier(ButtonModifier())
27-
28-
Button("Show the support view") {
29-
isSupportVisible = true
30-
}
31-
.disabled(isUserIdentified == false)
32-
.modifier(ButtonModifier())
33-
34-
Button("Register for push notifications") {
35-
UIApplication.shared.registerForRemoteNotifications()
36-
}
37-
.modifier(ButtonModifier())
38-
39-
Button("Unregister from push notifications") {
40-
UIApplication.shared.unregisterForRemoteNotifications()
41-
42-
Task {
43-
guard
44-
let deviceID = UIDevice.current.identifierForVendor?.uuidString
45-
else {
46-
return
47-
}
48-
49-
await DevRev.unregisterDevice(deviceID)
16+
HStack{
17+
Image(systemName: isUserIdentified ? "checkmark.square.fill" : "square")
18+
Text("Identified")
5019
}
51-
}
52-
.modifier(ButtonModifier())
53-
54-
Button("Create a new conversation") {
55-
Task { @MainActor in
56-
await DevRev.createSupportConversation()
20+
NavigationLink(destination: IdentificationView()) {
21+
Text("Identification")
22+
}
23+
NavigationLink(destination: PushNotificationView()) {
24+
Text("Push Notification")
25+
}
26+
NavigationLink(destination: SupportView()) {
27+
Text("Support")
28+
}
29+
.buttonStyle(PlainButtonStyle())
30+
NavigationLink(destination: SessionAnalyticsView()) {
31+
Text("Session Analytics")
5732
}
5833
}
59-
.modifier(ButtonModifier())
60-
}
61-
.sheet(isPresented: $isSupportVisible) {
62-
DevRev.supportView.ignoresSafeArea()
34+
.navigationTitle("Main Menu")
35+
.task {
36+
await checkIdentification()
37+
}
6338
}
64-
.padding()
6539
}
66-
}
67-
68-
struct ButtonModifier: ViewModifier {
69-
func body(content: Content) -> some View {
70-
content
71-
.buttonBorderShape(.capsule)
72-
.buttonStyle(.borderedProminent)
40+
private func checkIdentification() async
41+
{
42+
let isUserIdentified = await DevRev.isUserIdentified
43+
44+
await MainActor.run {
45+
self.isUserIdentified = isUserIdentified
46+
}
7347
}
7448
}
7549

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Foundation
2+
import SwiftUI
3+
import DevRevSDK
4+
5+
struct IdentificationView: View {
6+
@SwiftUI.State private var userIdentification = "Not Identified yet"
7+
8+
var body: some View {
9+
List {
10+
Text("User ID: \(userIdentification)")
11+
NavigationLink(destination: UnverifiedUserIdentificationView()) {
12+
Text("Unverified User Identification")
13+
}
14+
NavigationLink(destination: VerifiedUserVerificationView()) {
15+
Text("Verified User Verification")
16+
}
17+
}
18+
.navigationTitle("Identification")
19+
.task {
20+
if await DevRev.isUserIdentified {
21+
userIdentification = "User Identified"
22+
}
23+
}
24+
}
25+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Foundation
2+
import SwiftUI
3+
import DevRevSDK
4+
5+
struct UnverifiedUserIdentificationView: View {
6+
@SwiftUI.State private var userID = ""
7+
@SwiftUI.State private var isUserIdentified = false
8+
@SwiftUI.State private var showAlert = false
9+
@SwiftUI.State private var isSupportVisible = false
10+
11+
var body: some View {
12+
List {
13+
Section(header: Text("User Identification")) {
14+
TextField("Enter User ID", text: $userID)
15+
.textFieldStyle(RoundedBorderTextFieldStyle())
16+
.padding(.vertical, 8)
17+
18+
Button("Identify the Unverified User") {
19+
Task {
20+
isUserIdentified = await DevRev.isUserIdentified
21+
guard
22+
isUserIdentified
23+
else {
24+
return
25+
}
26+
27+
showAlert = true
28+
}
29+
}
30+
.padding(.vertical, 8)
31+
}
32+
}
33+
.navigationTitle("Unverified User Identification")
34+
.alert(isPresented: $showAlert) {
35+
Alert(
36+
title: Text("Success"),
37+
message: Text("The user has been successfully identified."),
38+
dismissButton: .default(Text("OK"))
39+
)
40+
}
41+
}
42+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Foundation
2+
import SwiftUI
3+
import DevRevSDK
4+
5+
struct VerifiedUserVerificationView : View {
6+
@SwiftUI.State private var userId = ""
7+
@SwiftUI.State private var sessionToken = ""
8+
9+
var body: some View {
10+
List{
11+
TextField("User Id", text: $userId)
12+
TextField("Session Token", text: $sessionToken)
13+
Button(action: {
14+
Task {
15+
await DevRev.identifyVerifiedUser(userId, sessionToken: sessionToken)
16+
}
17+
}) {
18+
Text("Verified User Identification")
19+
}
20+
}
21+
.navigationTitle("Verified User Identification")
22+
}
23+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import Foundation
2+
import SwiftUI
3+
import DevRevSDK
4+
5+
struct PushNotificationView: View {
6+
@SwiftUI.State private var showAlert = false
7+
@SwiftUI.State private var alertTitle = ""
8+
@SwiftUI.State private var alertMessage = ""
9+
10+
var body: some View {
11+
List {
12+
Button(action: {
13+
UIApplication.shared.registerForRemoteNotifications()
14+
showAlert(title: "Registered", message: "You have successfully registered for push notifications.")
15+
}) {
16+
Text("Register for Push Notifications")
17+
}
18+
Button(action: {
19+
UIApplication.shared.unregisterForRemoteNotifications()
20+
Task {
21+
guard
22+
let deviceID = UIDevice.current.identifierForVendor?.uuidString
23+
else {
24+
return
25+
}
26+
27+
await DevRev.unregisterDevice(deviceID)
28+
showAlert(title: "Unregistered", message: "You have successfully unregistered from push notifications.")
29+
}
30+
}) {
31+
Text("Unregister from Push Notifications")
32+
}
33+
}
34+
.navigationTitle("Push Notifications")
35+
.alert(isPresented: $showAlert) {
36+
Alert(
37+
title: Text(alertTitle),
38+
message: Text(alertMessage),
39+
dismissButton: .default(Text("OK"))
40+
)
41+
}
42+
}
43+
44+
private func showAlert(title: String, message: String) {
45+
alertTitle = title
46+
alertMessage = message
47+
showAlert = true
48+
}
49+
}

0 commit comments

Comments
 (0)