9

I've read that as of iPhone OS 3.1, GameKit supports wifi connections. But the documentation states:

"If your application configures the peer picker to allow Internet connections, your application must also dismiss the peer picker and present its own interface to configure an internet connection."

Does this still stand? If so, how do I establish a wifi Bonjour session that can be used by GK? (I'm only interested in using the local network.)

Felixyz
  • 19,053
  • 14
  • 65
  • 60

2 Answers2

13

Your GKSession object will automatically handle the discovery of peers over WiFi or Bluetooth, and find those that are available on either protocol.

The documentation is stating that unlike Bluetooth, for which GKPeerPickerController provides a UI to enable Bluetooth if it's not already enabled, GKPeerPickerController does not provide a UI to enable wifi, or select the network the user wishes to be on, you will have to provide your own.

ImHuntingWabbits
  • 3,827
  • 20
  • 27
  • Many thanks. So, something like this then: * create GKSession object * show a GKPickerController * the delegate method peerPickerController:didSelectConnectionType: is invoked with GKPeerPickerConnectionTypeOnline * dismiss the GKPickerController and display my own custom picker which uses the same GKConnection to find and display potential peers Does that sound about right? – Felixyz Dec 02 '09 at 16:37
  • In Apple documentation dated 2010-06-14: "A GKSession object provides the ability to discover and connect to nearby iPhones using Bluetooth." Not sure it can/will handle auto-discovery of wifi peers. – Thompsonian Jun 28 '10 at 21:09
0

You can use GKPeerPicker class..There is connectionTypesMask,it has property GKPeerPickerConnectionTypeNearby (for bluetooth connection or wireless). For more detail see my original answer.. gamekit over the internet

Community
  • 1
  • 1
Gajendra K Chauhan
  • 3,387
  • 7
  • 40
  • 55