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

孤人 提交于 2019-12-03 09:00:07
guenis

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.

I know this question references specific Xcode and iOS simulation versions, but if your simulator is already logged in one account, and you don't mind losing whatever data you've got on the simulator (chances are small, but you never know), you can simply reset the settings and data on it.

Go to: Simulator -> Reset Content and Settings...

...and confirm the action when prompted.

This is certainly true for Xcode7.x running an iOS 9.x simulator, someone else might be able to verify whether it's true for earlier versions (especially as I've unearthed quite an old question and answer).

Animal451

Necrothreadomancy: +1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!