用于检查 iPhone 与 USB 的连接的应用程序
我想知道 iPhone 是否以编程方式连接到 USB。
到目前为止,通过谷歌搜索我发现 http://developer.apple.com/programs/mfi/ 。
我真的需要这个 api 来查明 iPhone 是否连接到 USB 设备吗?
我只想制作一个 iPhone 应用程序,无论 iPhone 是否通过 USB 连接,它都会在控制台中打印出来。
非常感谢。
I want to know if an iPhone is connected to USB programmatically.
So far by googling i found http://developer.apple.com/programs/mfi/.
Do I really need this api to find out whether an iPhone is connected to USB device?
I just want to make an iPhone app that prints out in console whether the iPhone is connected with USB or not.
Thanks much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您也许可以使用此问题中的解决方案。
该解决方案会检测设备的电池当前是否正在充电,如果连接到 USB,很可能会这样,除非它是第 3 方配件,在这种情况下,我相信有不同的 SDK。
无论如何,如果解决方案没有帮助,它可能会为您指明正确的方向。
更新:
做了一些更多的挖掘,除了前面提到的电池充电解决方案之外,似乎这可能是不可能的。
因此,回答您的问题“我真的需要这个 api 来查明 iPhone 是否连接到 USB 设备吗?”:
是的,看起来是这样。
You might be able to use the solution from this question.
The solution detects if the device's battery is currently being charged which, if connected to USB, most likely will be unless it is a 3rd party accessory in which case there's a different SDK for those I believe.
In any case, if the solution isn't helpful it might point you in the right direction.
UPDATE:
Did some more digging and it appears that this may not be possible other than the battery charging solution mentioned previously.
So to answer your question "Do I really need this api to find out whether an iPhone is connected to USB device?":
Yes, it appears that way.