开发者

How to determine whether iOS device is connected to desktop computer (and iTunes)

开发者 https://www.devze.com 2023-03-09 03:11 出处:网络
Is there way to determine whether an iOS device is connected to a desktop computer usi开发者_如何学编程ng USB cable and it is listed on iTunes.Yes you can be notified of such events using TheExternal

Is there way to determine whether an iOS device is connected to a desktop computer usi开发者_如何学编程ng USB cable and it is listed on iTunes.


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 an EAAccessoryDidConnectNotification notification. When an accessory is disconnected, it sends an EAAccessoryDidDisconnectNotification notification. You can register to receive these notifications using the default NSNotificationCenter, and both notifications include information about which accessory was affected."

0

精彩评论

暂无评论...
验证码 换一张
取 消