GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
if (viewController != nil){
[self presentViewController:viewController animated:YES completion:nil];
GameCenterEnabled=YES;
}
else{}
if ([GKLocalPlayer localPlayer].authenticated) {
GameCenterEnabled=NO; //GameCenterEnabled = BOOL
}
else{
GameCenterEnabled=YES;
}
};
For my universal device ios app, after I click the button for Game Center log in, it logs in and everything works fine. When I quit the simulator and turn on the simulator again, I have to re-log in to GameCenter again. Why doesn't the simulator save my log in? Is there a code to save Game Center as always logged in if you logged in once before?
Aucun commentaire:
Enregistrer un commentaire