Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An application to check iPhone connection with 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.

like image 573
Steve Ham Avatar asked Nov 04 '22 14:11

Steve Ham


1 Answers

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.

like image 109
Beltalowda Avatar answered Nov 11 '22 11:11

Beltalowda