Reputation: 1
how can I communicate with another smartphone per example in a game? I'm developing in objective-c, I need to pass/receive informations about positions of some elements on the screen, but I've not ideas of how i can do this, can you give me some tips? Do i need a physical server with a socket open? and how can i manage the connection?
Thanks for any help. Jonathan.
Upvotes: 0
Views: 198
Reputation: 6949
Look into the peer-to-peer methods of GameKit. It's designed for multiple devices to communicate with each other. iOS only.
Upvotes: 1
Reputation: 5286
One phone can't readily programmatically talk directly to another phone. Well, you might be able to get phone A to send an email or SMS to phone B, but then phone B's app won't be able to act on the notification. (Since you mention obj-C I assume you're using iOS)
So you'll likely have to have a central server help out. Assuming apps running on both phones. Phone A can make an http request to the server; while phone B polls for a possible response. It can use a comet-like technique to reduce polling overhead.
Upvotes: 0