测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2016年12月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Alexander Yaremchuk,QueueITLibrary 维护。
将 Queue-IT 逻辑集成到 iOS 应用的库。SDK 将根据 Queue-IT 服务器响应发布相应的事件。作为 SDK 的用户,可以在以下情况下订阅通知:
func setupAndRunQueueIT {
let customerId = "exampleCustomerId"
let eventId = "exampleEventId"
let configId = "exampleConfigId"
let countDownWidget = WidgetRequest("CountDown", 1)
let progressWidget = WidgetRequest("Progress", 1)
let engine = QueueITEngine(customerId: customerId,
eventId: eventId,
configId: configId,
widgets: countDownWidget, progressWidget,
layoutName: "",
language: "",
onQueueItemAssigned: (onQueueItemAssigned),
onQueuePassed: (onQueuePassed),
onPostQueue: (onPostQueue),
onIdleQueue: (onIdleQueue),
onWidgetChanged: (onWidgetChanged),
onQueueIdRejected: (onQueueIdRejected),
onQueueItError: (onQueueItError))
engine.run()
}
func onQueueItemAssigned(queueItemDetails: QueueItemDetails) {
print(queueItemDetails.queueId)
}
func onQueuePassed() {
print("You have been redirected!")
}
func onPostQueue() {
print("Event has ended!")
}
func onIdleQueue() {
print("Event has not started yet!")
}
func onWidgetChanged(widget: WidgetDetails) {
print("Widget changed!: \(widget.name)")
if widget.name == "Progress" {
print("value: \(widget.data["progress"])")
}
}
func onQueueIdRejected(reason: String) {
print("QueueId rejected! Reason: \(reason)")
}
func onQueueItError(errorMessage: String) {
print("ERROR: \(errorMessage)")
}
The SDK logic does not execute in the background. Once the application view (which integrates with SDK)
goes out of scope, you will need to invoke run() method on QueueITEngine instance every time the view
needs to become active again.