Recent Films

Welcome to the Jungle

Mid-Afternoon Sessions

Will4Point9

EKS Aberdovey Visit
Recent Photos
www.flickr.com
This is a Flickr badge showing public photos and videos from ctr. Make your own badge here.

Friday, July 30, 2010

GameKit, iPad and iPhone

Filed under: Coding, iPhone — Chris Ross @ 8:33 pm

To get an iPad and an iPhone talking to each other you will need to implement the optional delegate method:

- (GKSession *)peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type {
return [[[GKSession alloc] initWithSessionID:@"ApplicationSessionID" displayName:[NSString stringWithFormat:@"iPad - %@", [[UIDevice currentDevice] name]] sessionMode:GKSessionModePeer] autorelease];
}

Otherwise they will not find each other as they are different application. Hope this helps, had me scratching my head for a while.