Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone to iPhone communication

I'm kind of curious how I should approach a problem with iPhones and communication between two phones.

I have an idea for an application that needs to send data between two known phones. The problem is that the data could be very small or very large. I want to have intermediate storage on a server and a messaging layer, but I want there to be performant means to communicate between devices for shorter, unimportant messages.

You always hear about networking and client to client communication with popular platforms and protocols, but I'm curious what people's thoughts are on doing p2p style communication with an iPhone.

I'm pretty sure it should (and can) be treated as just a simple addressable machine... so I would have to build NAT traversing network code into the iPhone itself. A thought I had would be some sort of UPnP situation where I would ask to NAT a particular port for communication to the devices... but I guess I could just as easily turn it into a polling situation.

Granted, I understand that Apple will have a "push" mechanism for developers eventually but I want to get the app out the door before hand...

Just curious about thoughts on this type of thing... any thoughts on multi-player game situations would also directly apply to (and benefit from) this question.

like image 634
whoisjake Avatar asked Oct 11 '08 17:10

whoisjake


People also ask

Can you touch iPhones together to share?

On your iPhone 11 or later Tap the AirDrop button. If the person that you want to share with also has an iPhone 11 or later model, point your iPhone in the direction of the other iPhone. Tap the profile picture of its user at the top of the screen.

What does connecting to someone's iPhone do?

Before you can exchange data, you need to pair the devices. Pairing, or connecting the phones, ensures that the data you send is secure and sent only to its intended source.


1 Answers

Have you given the WiTap sample from Apple a try? It addresses the issue of discoverability (via Bonjour) and connectivity (via basic TCP). It may not be as robust as what you are looking for, but it's worth a look:

http://developer.apple.com/iphone/library/samplecode/WiTap/index.html

like image 122
Adam Byram Avatar answered Sep 21 '22 07:09

Adam Byram