22 responses

  1. sternr
    June 20, 2011

    Hi, Thanks for the article!
    What changes do I need, to do the equivalent only on Wifi\internet?

    • Brian Vaughn
      August 1, 2011

      Hey mate. To use Wifi/internet, you’d need to configure your picker by changing…

      picker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;


      picker.connectionTypesMask = GKPeerPickerConnectionTypeOnline;

  2. Kasper
    October 4, 2011

    Hi – Thanks for the article

    I wonder if it is possible to create two apps, that connect to each other with GameKit. That is 2 apps with different App ID.

    In my scenario I would like to send an image taken from an iPhone, to a app created for iPad – Do you think that is possible?


    • Kasper
      October 4, 2011

      Found the answer. I just had to put this in the GKPeerPickerDelegate:

      #pragma mark – GKPeerPickerControllerDelegate
      – (GKSession *)peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type {
      // Create a session with a unique session ID – displayName:nil = Takes the iPhone Name
      GKSession* session = [[GKSession alloc] initWithSessionID:@”customName” displayName:nil sessionMode:GKSessionModePeer];
      return [session autorelease];

      Have a nice day

    • Eric
      October 4, 2011

      It’s very possible :)

  3. Arun
    November 28, 2011

    Thus the above code simply crashing the app when i changed the connection type to wifi

  4. Arun
    November 28, 2011

    Thus the above code simply crashing when i changed the connection type to online from NearBy.Can any body help me with this

  5. Eric
    November 28, 2011

    What is your console output for this crash? Let us know.

  6. Eric
    November 28, 2011

    What is your console output for this crash? Let us know.

  7. Shatthi
    February 1, 2012

    The tutorial is very helpful in understanding bluetooth communication between two appliactions using Gamekit.
    Is it possible to initiate bluetooth communication from iphone application to another iphone’s bluetooth feature (without having an application installed in it) ?

    • Eric
      February 1, 2012

      You would need an app of some kindi believe, even if just GameKit.

  8. Chris
    May 18, 2012


    I’m a bit of a programming beginner, but for a project I’m looking to use this basic idea to send information between 2 devices. I notice that you say to include the 4 elements in you XIB file but I can only see 3 elements being synthesized? Unless GKsession is an element in which case what do I have to put there? Also, where would the send actrion be connected to?

    Again, I apologise if these are obvious questions, I’ve got 3 weeks to complete this project and I’m starting to struggle!


    • Eric
      May 18, 2012

      @synthesize currentSession;

  9. Garrett
    June 20, 2012

    Thanks for the tutorial…is it possible to connect more than two devices?

    If so, what would be the max number of devices?


  10. Ryan
    July 13, 2012

    Hi Eric,
    I am pretty new to programming so I was wondering if you could either show/explain to me what the user interface should look like. Thank you for your help.

  11. GW
    August 7, 2012

    Hello! thank u so much for the great tutorial!
    I have one question though ;) if you don’t mind.
    will it be possible that if I send back and forth audio files? not txt.
    if I can, where should I implement or save audio files?
    thank you!

  12. CJ
    December 25, 2012

    Hello great tutorial,

    Just wondering i have two labels that have different text that i want to send. how would i go about doing this?

    • Eric
      December 25, 2012

      You mean combine the strings? I’m not sure what you mean.

      • CJ
        December 25, 2012


        what i mean is say i have label one and label 2, label one has say the number 123 and label two has got the number 456 in it. When i press send i want the labels on the other screen to change to this as they do not have those values but im not sure how to create two nstrings in two nsdatas and send and then recieve the two as right now it only sends the first label but i cant get and set the second data.

      • Eric
        December 26, 2012

        Combine into one string with a delimiter (say a comma or something that makes sense), send once. On your receiveData just split at the delimiter and use the two strings. Save yourself a data send.

  13. Steve
    March 27, 2013


    Is it possible to connect multiple devices (ie more than two?) For example, I’m wanting to connect 3 ipods/iphones up to an iPad. The iPhones/pods will send date to specific fields on the iPad. Do you know if this is possible? If so, how do I create the connections for each of the devices? Your code works great for a simple tutorial…just not sure how to extend.

    Any help would be great!


    • Eric
      March 27, 2013

      Yes – since it’s using GameKit, you can have many devices connected. The limit is 16 connected devices. I have started to abstract the whole thing and placed it on GitHub. If you’ve created connections for two I believe you would execute a join on another device and once approved it would be part of the same ring of communication. You shouldn’t need to do anything different than what’s already coded.

Leave a Reply




four + = 9

Back to top
mobile desktop