Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can my iphone app communicate with a connected computer?

Preferably, this would be a computer connected via cable, but if there's a way to do it over wifi then this would also be useful. I'm wondering if it's possible to send messages between them?

Or if i had a mac app and an iPhone app, could I communicate between them over wifi or a usb connection, rather than using a server or something?

like image 526
Andrew Avatar asked Jan 31 '11 03:01

Andrew


1 Answers

Connecting over WiFi is possible, cable connection however isn't possible (certainly not in the documented API) unless the phone is jailbroken.

For wifi you're just going to connect to a TCP/IP host/socket. Have a look at CocoaAsyncSocket. The computer would need to be hosting some sort of server software. This is how iTunes Remote and AirMouse work.

like image 118
ocodo Avatar answered Sep 30 '22 02:09

ocodo