Types of Peer-to-peer connection - iphone

I am developing an application and trying to use an peer-to-peer communication. i have idea about bluetooth and WIFI.
Is their any other options for peer-to-peer communication. Is it possible using Internet option.
Please help me with a source code or any documentation?..

Check Apple's Documentation on the GameKit. That provides you exactly with what you are asking for.

WIFI is internet. I'm not quite sure what you mean.

Related

Communication between two iOS devices

I am looking for a way to have one iPhone app send a message to another app on a different phone (sort of like a Sender-Receiver set up). I am looking for the best possible way to do this. Does anyone have any ideas and/or tutorials?
Thanks for the help.
You should use GameKit. It is super easy to send messages between two iOS devices using it. Here's a great tutorial: Game Kit. You can also get more information about it here from the docs: About Game Kit.
You communicate by creating an ad-hoc bluetooth or local wireless network.
lmirak provided insightful info about device communication(especially about GameKit). I would like to add one more solution. You can use WiFi network to do your device communication.
See the link or download the sample application from developer.apple
The sample application named as WiTap. It demonstrates how to achieve network communication between applications. Using Bonjour, the application both advertises itself on the local network and displays a list of other instances of this application on the network.
If your app is only going to run on iOS, then you should use the fantastic MultipeerConnectivity library. https://developer.apple.com/documentation/multipeerconnectivity
If you need a solution that will work cross-platform, then one way to accomplish this is using sockets and connecting over a local network. On iOS you can use CocoaAsyncPods for sockets and NetService for discovery.
Here is a basic example app that does this: https://github.com/brendaninnis/LocalNetworkingApp
, which I explain in great detail here: http://brendaninnis.ca/connect-nearby-devices-part-1.html

setting up iPhone P2P only over bluetooth and without GKPeerPickerController

I want to use a custom interface to connect with other iDevices in a p2p game. I know I can either use GKSession and GKSessionDelegate or use the lower level Bonjour browsing. But both of them will search for devices both over bluetooth AND wifi.
I want to list only bluetooth devices. I know this was answered in the past as impossible, but the Flight Control app seems to be able to do it.
I thought I would answer to let you know that YOU ARE NOT ALONE, I am trying to do the same thing and it is kicking my butt! This link might help you:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/40710-gamekit-api.html
I am trying to setup a server/client relationship and that requires me to use my own custom interface too.

iPhone to iPhone communication

I have been looking into communication methods between two iPhone devices and as I understand it there are two main methods to do this: Bluetooth and WiFi. However I wanted to know if anyone knows of any other way of sharing information between two iPhones? If I were in an area with no WiFi or mobile signal, and couldn't use Bluetooth for whatever reason, is there anything that could be done to broadcast data from one iPhone to another?
I'm sure its a bit of a silly question, but if you don't ask, you don't get; and if someone knows of anything I might be able to look into with regards to this, I would be very appreciative.
Thanks,
Dan
AFAIK Wifi and Bluetooth are your only options for direct phone-to-phone communication.
Offcourse, there is still cellular data network because you are talking about the iPhone ;)

iphone PC TCP/IP connection

I'm looking for the faster and easy way to connect the iphone to the PC with IP/Port connection.
Anyone has a good idea?
thanks in advance
Gilad
Not sure if this is what you are looking for, but this Mobile Development Wiki provides some information on how to communicate using low level sockets on the iPhone.

iPhone Gamekit peer with a desktop peer

I am looking for a way to establish a wireless connection between an iPhone and a desktop client. Gamekit looks promising but all the examples / documentation only explain iPhone to iPhone.
Are there examples / documentation for an Gamekit peer on the desktop (cocoa or java)?
What are the alternatives without doing to much low level socket programming?
The iPhone emulator does not run these bluetooth p2p connections. Hence, it can only be tested with real hardware.
It is a little confusing because the GKSession reference talks only about being a way to connect peers over bluetooth, while the GKPeerPickerController states "can be configured to select between Bluetooth and Internet connections." However there's a clear note there that they're not really going to help you with internet based connections.
This is unfortunately a non-answer, but...
GameKit is an abstraction of the bluetooth and wifi networking layers, allowing a specific set of protocols for communication between two devices -- to communicate with a desktop client, you would need to replicate all of the GameKit functionality on the desktop, since there is no comparable API on the desktop. This would not be a simple undertaking.
I would highly suggest developing something over bonjour, as #Jordan suggested. Bill Dudney's project (blog article). It's a great place to start.
Citing Game Kit Framework Reference's Features paragraph:
Peer-to-peer connectivity allows your game to create an ad hoc Bluetooth or wireless network between multiple iPhones in the same local area. Although designed with games in mind, this network is useful for any type of data exchange among users of your app. For example, an app could use peer-to-peer connectivity to share electronic business cards or other data. This functionality is only available on iOS. You can also get the same functionality using Game Center.