I have faced an unexplainable problem while working with GameKit. When establishing connection over WiFi (picker.connectionTypesMask = GKPeerPickerConnectionTypeOnline;
) devices cannot see each other. they see nothing while simulator sees everything, it can see any device or a simulator working on a different machine. i've been banging my head over it for few days already trying to understand why it works on a simulator but not on a device. Can anyone please help me?
This is how i create my session
if (type == GKPeerPickerConnectionTypeOnline)
{
picker.delegate = nil;
[picker dismiss];
[picker autorelease];
[alert setTitle:@"\n\n\n"];
[alert setMessage:@"Looking for other iPads, iPhones or iPod touches..."];
[alert addButtonWithTitle:@"Cancel"];
UIActivityIndicatorView *progress = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)];
progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
[alert addSubview:progress];
[progress startAnimating];
[alert show];
self.gameSession = [[GKSession alloc] initWithSessionID:kSessionID displayName:nil sessionMode:GKSessionModePeer];
self.gameSession.available = YES;
self.gameSession.delegate = self;
self.gameSession.disconnectTimeout = 0;
[self.gameSession setDataReceiveHandler:self withContext:nil];
}