如何确定iOS设备是否连接到台式电脑(和iTunes)
有没有办法确定 iOS 设备是否使用 USB 线连接到台式电脑并且在 iTunes 上列出。
Is there way to determine whether an iOS device is connected to a desktop computer using USB cable and it is listed on iTunes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以使用外部通知此类事件附件框架。
“每当连接或断开硬件附件时,它都能够发送通知。虽然它有能力,但它不会自动执行此操作。您的应用程序必须明确请求通过调用生成通知这
EAAccessoryManager
类的 registerForLocalNotifications 方法 当附件已连接、经过身份验证并准备好与您的应用程序交互时,框架会在附件断开连接时发送EAAccessoryDidConnectNotification
通知。它会发送EAAccessoryDidDisconnectNotification
通知,您可以使用默认的NSNotificationCenter
注册接收这些通知,并且这两个通知都包含有关哪个配件受到影响的信息。”Yes you can be notified of such events using The External Accessory framework.
"It is capable of sending notifications whenever a hardware accessory is connected or disconnected. Although it is capable, it does not do so automatically. Your application must specifically request that notifications be generated by calling the registerForLocalNotifications method of the
EAAccessoryManager
class. When an accessory is connected, authenticated, and ready to interact with your application, the framework sends anEAAccessoryDidConnectNotification
notification. When an accessory is disconnected, it sends anEAAccessoryDidDisconnectNotification
notification. You can register to receive these notifications using the defaultNSNotificationCenter
, and both notifications include information about which accessory was affected."