I am trying to save game data in iCloud through the following code:
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; [localPlayer saveGameData:[NSData dataWithBytes:rawData->data() length:rawData->size()] withName:[NSString stringWithUTF8String:fileName.c_str()] completionHandler:^(GKSavedGame *savedGame, NSError *error) { if (error == nil) { DebugLog(@"Snapshot successfully saved"); } else { DebugLog(@"saveSnapshot error: %@", error.description); } }];
But getting an error message: The requested operation could not be completed because you are not signed in to iCloud
I tried to do this in iOS Simulator and on the device, but failed.
And tried to use the test apple id, apple apple id, new apple id, but also failed.
The user connected to iCloud in the iOS settings and entered the Game Center.
Any suggestions?
source share