提供使用 SPACER 储物柜的操作。
更多信息,请参阅 文档
提供使用 BLE 的储物柜操作
- 扫描储物柜
- 将您的行李存放在储物柜中
- 从储物柜中取出您的行李
- 临时解锁储物柜
提供您正在使用的储物柜的操作
- 获取正在使用的储物柜
- 预订可用的储物柜
- 取消已预订的储物柜
- 分享您正在使用的储物柜
- 获取正在使用的维护储物柜
提供基本的储物柜信息
- 获取多个储物柜的基本信息
- 获取多个储物柜单元的基本信息
提供基本的位置信息
- 获取多个单元的基本位置信息
- iOS 11.0+
- 低功耗蓝牙 (BLE) 4.2+
「info.plist」→「打开为」 →「源代码」
请添加以下键和值
请将值中的文字更改为您公司适当的文字
<dict>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Used to detect lockers.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Bluetooth is used to communicate with BLE devices.</string>
「info.plist」→「打开为」 →「源代码」
请添加以下键和值
请将值中的文字更改为您公司适当的文字
<dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used to detect lockers.</string>
import SpacerSDK
let cbLockerService = SPR.cbLockerService()
// Scan lockers
cbLockerService.scan(
token: token,
success: { sprLockers in
},
failure: { error in
}
)
// Deposit your luggage in the locker
cbLockerService.put(
token: token,
spacerId: spacerId,
success: {
},
failure: { error in
}
)
// Take your luggage out of the locker
cbLockerService.take(
token: token,
spacerId: spacerId,
success: {
},
failure: { error in
}
)
// Temporarily unlock locker
cbLockerService.openForMaintenance(
token: token,
spacerId: spacerId,
success: {
},
failure: { error in
}
)
import SpacerSDK
let myLockerService = SPR.myLockerService()
// Get a locker in use
myLockerService.get(
token: token,
success: { myLockers in
},
failure: { error in
}
)
// Reserve an available locker
myLockerService.reserve(
token: token,
spacerId: spacerId,
success: { myLocker in
},
failure: { error in
}
)
// Cancel the reserved locker
myLockerService.reserveCancel(
token: token,
spacerId: spacerId,
success: {
},
failure: { error in
}
)
// Share your locker in use
myLockerService.shareUrlKey(
token: token,
urlKey: urlKey,
success: { myLocker in
},
failure: { error in
}
)
// Get maintenance lockers in use
myLockerService.getMyMaintenanceLocker(
token: token,
success: { myMaintenanceLockers in
},
failure: { error in
}
)
import SpacerSDK
let sprLockerService = SPR.sprLockerService()
// Get multiple locker basic information
sprLockerService.get(
token: token,
spacerIds: spacerIds,
success: { sprLockers in
},
failure: { error in
}
)
// Get multiple locker unit basic information
sprLockerService.get(
token: token,
unitIds: unitIds,
success: { sprUnits in
},
failure: { error in
}
)
import SpacerSDK
let locationService = SPR.locationService()
// Get multiple unit location basic information
locationService.get(
token: token,
locationId: locationId,
success: { sprLocation in
},
failure: { error in
}
)
您可以在 Example 项目中检查 Spacer SDK 的操作。请参阅 示例代码
- 打开
Example
项目 - 在环境变量中设置
SDK_TOKEN
的值 - 在 iPhone 上构建和运行
最初,从您的服务器获取的 SPACER 发起的令牌设置为测试。
如何获取 sdk.token
,请参阅 文档
pod 'SpacerSDK'
dependencies: [
.package(url: "https://github.com/spacer-dev/spacer-sdk-ios.git", .upToNextMajor(from: "1.1.0"))
]
本软件根据 MIT 许可协议发布,请参阅 LICENSE。