iPhone Simulator 6.0 not able to connect to gamecenter in sandbox mode

后端 未结 2 883
攒了一身酷
攒了一身酷 2021-02-11 02:01

I\'m trying to implement a gamecenter aware app targeted to iOS 6. To give some info on the environment I\'m working on mac os 10.7.5 with XCode version is 4.5.2 and xcode is ru

2条回答
  •  既然无缘
    2021-02-11 02:52

    I got the inspiration from : https://stackoverflow.com/a/8115807/837244, and decided to log in to game center account with a different piece of code. So in viewdidload I normally called:

    [[GCHelper sharedInstance] authenticateLocalUser:self];
    

    Now I commented that out, accessed game center through below URL scheme, logged in to my account and after that logged out.

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:"]];
    

    And lastly reverted back by commenting out URL code and using the original code. Now it works fine, I guess the problem was that a game center account was already hooked up in simulator and it denied every login request bc of that. Hope apple goes clearer with error messages, it took a month to fix such a simple issue, may this help to others.

提交回复
热议问题