Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't saveGameData because "not signed in to iCloud" although I am signed

I get the error:

Error Domain=GKErrorDomain Code=27 "The requested operation could not be completed because you are not signed in to iCloud" UserInfo=0x1889f160 {NSLocalizedDescription=The requested operation could not be completed because you are not signed in to iCloud}

when I'm trying to save game data using this obvious code:

[[GKLocalPlayer localPlayer] saveGameData:serializedData withName:@"SaveName" completionHandler:^(GKSavedGame *savedGame, NSError *error) {
if (savedGame != nil) {
    NSLog(@"Player data saved to GameCenter: %@", savedGame);
} else {
    NSLog(@"Player data NOT saved to GameCenter, error: %@",  error.description);
}
}];

It's even more strange because it worked two weeks ago, so I commented it out and started coding other stuff: leaderboards, in-app purchase – and all these work.

I'm testing it on my iPhone (iOS 8.1.3) logged to Game Center, to iCloud, I've got iCloud Drive turned on, but saving doesn't work. I even set up a new test account, but with the same result.

Could testing all these functionalities on same test account make this problem or it's time to contact Apple?

like image 653
Tom Avatar asked Feb 17 '15 14:02

Tom


2 Answers

I´ve had the same problem.

try to log into icloud with your standard account(not TestUser). activate iCloud > iCloud Documents in Capabilities. Turn ON iCloud Drive in Phone Settings (Device) and it should work.

like image 91
NeoGER89 Avatar answered Sep 28 '22 09:09

NeoGER89


Had the same problem. I did add iCloud Capabilities, but only in ReleaseForProfiling mistakenly. I should do it in ALL sections. select all in capabilities

like image 32
Richard Fu Avatar answered Sep 28 '22 09:09

Richard Fu