当前位置: 首页 > 文档资料 > Rokid IOS SDK 文档 >

设备抢绑

优质
小牛编辑
125浏览
2023-12-01

说明

当设备被其他账号绑走时,Mobile SDK 会收到以下消息。

消息体

ChannelMessage

Topic

UNIVERSAL_UNBIND_TO_USER

例子

Swift:

NotificationCenter.rokidsdk.addObserver(self, selector: #selector(handleChannelMsgsNotification(_:)), name: NSNotification.Name(rawValue: SDKNotificationName.ChannelMessages ), object: nil)

@objc private func handleChannelMsgsNotification(_ notification: Notification) {
    print("\(String(describing: notification.userInfo))")
    // TODO 解析 notification.userInfo 判断 topic 是否为 "UNIVERSAL_UNBIND_TO_USER"
}

ChannelMessageBean 说明:

参数类型说明
sourceDeviceChannelDeviceBean发送消息对象
reviceDeviceChannelDeviceBean接收消息对象
topicString消息类型
textString消息结构体

ChannelDeviceBean 说明:

参数类型说明
accountIdString账号Id
deviceIdString设备Id
deviceTypeIdString设备类型