I'm trying to save game's data to iCloud via next 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 error message: The requested operation could not be completed because you are not signed in to iCloud
I've tried to do this in iOS Simulator and on device but didn't succeed.
And tried to use test apple ID, dev apple ID, new apple ID, but didn't succeed too.
User is logged in to iCloud in iOS Settings and logged in to Game Center.
Any suggestions?
iCloud and Google Play will back up your game as you play. To save your progress, log in to Google Play (on Android devices) or iCloud, (on Apple devices) play the game for some time to ensure your progress is saved to that service.
Under the Settings menu, go to iCloud, then select Documents and Data. Make sure it's turned to "ON". Under the Documents and Data menu, select on (or green) for your desired game and you should be good to go.
Answer: A: Yes, go to Settings > Name > iCloud > see if the game(s) is/are listed under Apps Using iCloud. If not, go to Settings > Name > iCloud > Manage Storage > Backups > device you're on > see if the game(s) is/are listed under Choose Data To Back Up and turn on.
You can use iCloud and Game Center to keep your progress, high scores, and game saves up-to-date across your devices. If you're signed in to the same iCloud and Game Center accounts and download Apple Arcade games from the App Store on all of your devices, you can access your game saves and progress on all of them.
I had a similar issue. After I signed in with my iCloud account on my device's settings, the exact same error was still showing up, and it only stopped when I enabled the iCloud Drive for my account, otherwise it will never work.
So, it looks like the user must be using iCloud Drive, otherwise GKSavedGame will never work. Apple docs never mention that as far as I'm aware.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With