Skip to content

Commit 796363e

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 796363e

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed
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)