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

2

6

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?

Unquote answered 17/2, 2015 at 14:38 Comment(0)
C
8

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.

Clegg answered 19/2, 2015 at 9:24 Comment(3)
The documentary says only GameKit framework is required to use saveGameData, so I thought the app doesn't use iCloud framework directly. I wasn't sure about it so I've checked all iCloud services, but "iCloud Documents" and that was it – tanks a lot!Unquote
In my case, I did add iCloud Capabilities, but only in ReleaseForProfiling, I should do it in ALL sections.Ticket
With Phone Settings, you mean on the actual phone?Eboni
T
2

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

Ticket answered 26/6, 2020 at 4:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.