Search code examples
iosiphoneipadgamekit

Apple GameKit - How to connect multiples iPhone to an Ipad as a server but with different Bundle IDs


I was going through the iOS Developer Library looking for a way to achieve what the iPad Scrabble app does, which is to host a game on an iPad and have multiple iPhones connect to it via Bluetooth.

I know it could be possible to play a multiplayer game using the GameKit if everyone had the app with the same Bundle Identifier. The problem is, in the Scrabble case, you download 2 different apps, and they can still connect to each other.

This puzzles me since the developper library states:

Note: Matchmaking can be done only with other copies of the same application (that is, applications that share the same bundle identifier). You cannot perform matchmaking between two different applications.

Any idea how this could be achieved? I basically would like a free app on iPhone displaying stuff called from the server on the iPad.

Thanks!


Solution

  • so you cannot using match making that provided by game center but you can manually create GKSession using initWithSessionID:displayName:sessionMode: and pass same session ID for different application

    and you need to make your own session picker view and implement GKSessionDelegate

    https://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/GameKit_Guide/GameKitConcepts/GameKitConcepts.html#//apple_ref/doc/uid/TP40008304-CH100-SW18