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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With