1 Reply
      Latest reply on Jul 21, 2019 9:13 AM by dark1games
      prestigegaming Level 1 Level 1 (0 points)

        So our most recent app submission was rejected because we allow users to buy virtual coins (they also get them free every hour) and one of the things they can buy with those coins is the ability to "unlock" a category.  The reviewer said because they may have bought the coins they treat the categories as a "non-consumable" and therefore we have to save that information so they can retreive it on other devices.


        I had a follow up call with a lady at the review board and she said that we could use Game Center to save off the data.  I took a look at GKLocalPlayer and there is a function "saveGameData" to save a data buffer to the Game Center cloud.  Pretty straight forward even without any documentation.  However, getting the data back using GKLocalPlayer fetchSavedGamesWithCompletionHandler is NOT nearly so straight foward.  I found this small piece of code for it, but it does not now how to resolve the array.


        GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
        [localPlayer fetchSavedGamesWithCompletionHandler : ^ (NSArray<GKSavedGame *> * _Nullable savedGames, NSError * _Nullable error)
            if (error == nil)
                NSLog(@"%@", savedGames);
                NSLog(@"fetchSavedGamesWithCompletionHandler error: %@", error.description);


        I have searched for samples/examples of how to use this to retrieve the data and there is NOTHING that I can find.  Nothing in the Xcode docs.  Nothing online.  Nothing at StackOverflow.  Nothing anywhere.


        Is anyone using these functions to save to the Game Center cloud?  If so, can you provide a code snippet on retrieving the data buffer (and resolving the GKSavedGame data array if there are multiple entries with the same name).


        Hard to believe they have something that appears to be really useful, but no samples.