Skip to content

Commit c7a2025

Browse files
feat(api): expose public interface for WaitingRoom components
Make WaitingRoomProvider and WaitingRoomView classes and their protocols publicly accessible to enable external usage of the SDK components.
1 parent b1e643c commit c7a2025

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

Sources/QueueITLib/QueueITEngine.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,38 +96,38 @@ public final class QueueItEngine {
9696
}
9797

9898
extension QueueItEngine: WaitingRoomViewDelegate {
99-
func notifyViewUserExited() {
99+
public func notifyViewUserExited() {
100100
queueUserExitedDelegate?.notifyUserExited()
101101
}
102102

103-
func notifyViewUserClosed() {
103+
public func notifyViewUserClosed() {
104104
queueViewClosedDelegate?.notifyViewClosed()
105105
}
106106

107-
func notifyViewSessionRestart() {
107+
public func notifyViewSessionRestart() {
108108
queueSessionRestartDelegate?.notifySessionRestart()
109109
}
110110

111-
func notifyQueuePassed(info: QueuePassedInfo?) {
111+
public func notifyQueuePassed(info: QueuePassedInfo?) {
112112
queuePassedDelegate?.notifyYourTurn(queuePassedInfo: info)
113113
}
114114

115-
func notifyViewQueueDidAppear() {
115+
public func notifyViewQueueDidAppear() {
116116
queueViewDidAppearDelegate?.notifyQueueViewDidAppear()
117117
}
118118

119-
func notifyViewQueueWillOpen() {
119+
public func notifyViewQueueWillOpen() {
120120
queueViewWillOpenDelegate?.notifyQueueViewWillOpen()
121121
}
122122

123-
func notifyViewUpdatePageUrl(urlString: String?) {
123+
public func notifyViewUpdatePageUrl(urlString: String?) {
124124
// TODO: fix optional parameter
125125
queueUrlChangedDelegate?.notifyQueueUrlChanged(url: urlString ?? "")
126126
}
127127
}
128128

129129
extension QueueItEngine: WaitingRoomProviderDelegate {
130-
func notifyProviderSuccess(queuePassResult: TryPassResult) {
130+
public func notifyProviderSuccess(queuePassResult: TryPassResult) {
131131
switch queuePassResult.redirectType {
132132
case "safetynet":
133133
let queuePassedInfo = QueuePassedInfo(queueitToken: queuePassResult.queueToken)
@@ -141,7 +141,7 @@ extension QueueItEngine: WaitingRoomProviderDelegate {
141141
}
142142
}
143143

144-
func notifyProviderFailure(errorMessage: String?, errorCode: Int) {
144+
public func notifyProviderFailure(errorMessage: String?, errorCode: Int) {
145145
// TODO: fix optional parameter
146146
let errorMessage = errorMessage ?? ""
147147
if errorCode == 3 {
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import Foundation
22

3-
struct TryPassResult {
4-
let queueUrl: String?
5-
let targetUrl: String?
6-
let redirectType: String
7-
let isPassedThrough: Bool
8-
let queueToken: String?
3+
public struct TryPassResult {
4+
public let queueUrl: String?
5+
public let targetUrl: String?
6+
public let redirectType: String
7+
public let isPassedThrough: Bool
8+
public let queueToken: String?
99
}

Sources/QueueITLib/WaitingRoomProvider.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
protocol WaitingRoomProviderDelegate: AnyObject {
3+
public protocol WaitingRoomProviderDelegate: AnyObject {
44
func notifyProviderSuccess(queuePassResult: TryPassResult)
55
func notifyProviderFailure(errorMessage: String?, errorCode: Int)
66
}
@@ -15,11 +15,11 @@ enum QueueITRuntimeError: Int {
1515
]
1616
}
1717

18-
final class WaitingRoomProvider {
18+
public final class WaitingRoomProvider {
1919
static let maxRetrySec = 10
2020
static let initialWaitRetrySec = 1
2121

22-
weak var delegate: WaitingRoomProviderDelegate?
22+
public weak var delegate: WaitingRoomProviderDelegate?
2323

2424
private let customerId: String
2525
private let eventOrAliasId: String
@@ -30,27 +30,27 @@ final class WaitingRoomProvider {
3030
private var requestInProgress: Bool = false
3131
private let internetReachability: Reachability
3232

33-
init(customerId: String, eventOrAliasId: String, layoutName: String? = nil, language: String? = nil) {
33+
public init(customerId: String, eventOrAliasId: String, layoutName: String? = nil, language: String? = nil) {
3434
self.customerId = customerId
3535
self.eventOrAliasId = eventOrAliasId
3636
self.layoutName = layoutName
3737
self.language = language
3838
internetReachability = Reachability.reachabilityForInternetConnection()
3939
}
4040

41-
func tryPass() throws {
41+
public func tryPass() throws {
4242
try tryEnqueue(enqueueToken: nil, enqueueKey: nil)
4343
}
4444

45-
func tryPassWithEnqueueToken(_ enqueueToken: String?) throws {
45+
public func tryPassWithEnqueueToken(_ enqueueToken: String?) throws {
4646
try tryEnqueue(enqueueToken: enqueueToken, enqueueKey: nil)
4747
}
4848

49-
func tryPassWithEnqueueKey(_ enqueueKey: String?) throws {
49+
public func tryPassWithEnqueueKey(_ enqueueKey: String?) throws {
5050
try tryEnqueue(enqueueToken: nil, enqueueKey: enqueueKey)
5151
}
5252

53-
func isRequestInProgress() -> Bool {
53+
public func isRequestInProgress() -> Bool {
5454
return requestInProgress
5555
}
5656
}

Sources/QueueITLib/WaitingRoomView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import UIKit
22

3-
protocol WaitingRoomViewDelegate: AnyObject {
3+
public protocol WaitingRoomViewDelegate: AnyObject {
44
func notifyViewUserExited()
55
func notifyViewUserClosed()
66
func notifyViewSessionRestart()
@@ -10,20 +10,20 @@ protocol WaitingRoomViewDelegate: AnyObject {
1010
func notifyViewUpdatePageUrl(urlString: String?)
1111
}
1212

13-
final class WaitingRoomView {
13+
public final class WaitingRoomView {
1414
weak var host: UIViewController?
15-
weak var delegate: WaitingRoomViewDelegate?
15+
public weak var delegate: WaitingRoomViewDelegate?
1616
weak var currentWebView: WebViewController?
1717

1818
private var eventId: String
1919
private var delayInterval: Int = 0
2020

21-
init(host: UIViewController, eventId: String) {
21+
public init(host: UIViewController, eventId: String) {
2222
self.host = host
2323
self.eventId = eventId
2424
}
2525

26-
func show(queueUrl: String, targetUrl: String) {
26+
public func show(queueUrl: String, targetUrl: String) {
2727
raiseQueueViewWillOpen()
2828

2929
let queueWKVC = WebViewController(
@@ -53,7 +53,7 @@ final class WaitingRoomView {
5353
}
5454
}
5555

56-
func setViewDelay(_ delayInterval: Int) {
56+
public func setViewDelay(_ delayInterval: Int) {
5757
self.delayInterval = delayInterval
5858
}
5959
}

0 commit comments

Comments
 (0)