2

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];
}
Andrey Chernukha
  • 21,488
  • 17
  • 97
  • 161
  • did you get working. I have 3 devices. who cant search each other using wifi, but – Bonnie Dec 11 '12 at 08:50
  • Any update on this? I have the same problem. It only seems to be on some networks though. I have a feeling it may be related to ports used? – bencallis Jan 16 '13 at 15:03

0 Answers0