Reset completed achievements in Game Centre - ios

I am debugging code for achievements in my sprite kit game. When you gain an achievement it goes immediately to 100% achieved - they are one off achievements where you have done a specific thing. The game has NOT been released on the app store.
While doing so I have (somehow) accidentally reported to Game Centre that all my achievements have been completed. To continue debugging I need to reset the achievements to the un-achieved status.
Is there a way to do this?
I know there is resetAchievements(completionHandler: ((Error?) -> Void)? but that just resets percentages of partially completed achievements.
I have 10 achievements at the moment so if there’s no possibility to reset completed achievements then I’ll need to make 10 more, which is tedious, and test them using increments in percentages instead

Related

IOS Sprite Kit Game Center Can't Add Leaderboard in Itunes Connect

I am developing a simple 2D sprite kit game for IOS. I added a leaderboard and some demo accounts to test it out and it all worked fine.
Yesterday, i decided it was time to release version 1.0 of the app and before i submitted the app for review i deleted the existing leaderboard just to make sure no fake scores from my demo accounts remain.
I then submitted the app for review and later when i tried to add a new leaderboard, the process works normally until i reach the point where i press save (to make the leaderboard active) but the button is greyed out no matter what i do. i read the documentation and searched online for similar cases and tried all of the following:
Made sure game center is enabled
chose single leaderboard
made sure the leaderbard reference name is correct
made sure the leaderboard Id is correct
Chose a score format
made sure to write the score range in numbers
create a localization language
however, the save button remains grey and i can not add a leaderboard. i tried today as well, the original leaderboard was deleted and stil the same issue. now when i try to play my game (on my test device) when i reach the end and the score should be submitted, the game crashes (since there is no leaderboard and my code submits the score at this point)
If my game is accepted and goes online it wouldn't be a good thing to have it crashing from version 1.0. I do not know what is causing this and what i can do to solve it, would appreciate any help.
Thank you

iOS App submission is rejected as using Game Centre Leaderboards and Achievements but has not submitted for review

My app has been rejected by Apple for 4 times due to the message they sent:
"Your app is using Game Center Leaderboards and Achievements but you have not submitted the them for review."
My app uses Game Centre for Multiplayer mode, however, it does not have any leaderboards or achievements feature, game centre is simply enabled for multiplayer.
Please see the following screenshot for detail.
As you can see, under my app there is no leaderboards or achievements is selected. The only selected game centre option is "Multiplayer compatibility".
In apple's reject email says if I don't use leaderboards or achievements I can turn off game centre, however, as the game need Game Centre for multiplayer, I believe I cannot turn it off.
Under app's "Game Centre" tab in iTunnesConnect, I do have created some leaderboards and achievements, but those are for future updates which is not yet ready in this release. I didnt link those items with my app's submission as the above screenshot indicated.
The following is a screenshot shows the unfinished items I created for leaderboard and achievements. Once again, they are still under development and I didn't link any of them with the current app's submission.
And if you have a closer look I cannot actually delete every leaderboards as the 1st leaderboard item's delete button is disabled.
As it is getting very close to the app's launch date, it is getting critical. Please advice how can I fix this issue "your app is using Game Center Leaderboards and Achievements but you have not submitted the them for review."
Thank you very much!
The following is the full response from Apple:
2.3 - Apps that do not perform as advertised by the developer will be rejected
Thank you for your resubmission and for addressing the previous 2.2 issue. However the 2.3 issue is still presented in your app since the Game Center remains enabled for your app but no Game Center features were submitted.
If you intended to implement Game Center features in your app, please revise your app to include these features. Alternatively, you may wish to disable Game Center for your app and remove all Game Center references from your Application Description, What’s New info and screenshots.
2.3 Details
We still found that your app is using Game Center Leaderboards and Achievements but you have not submitted the them for review.
Next Steps
Please submit the Leaderboards and Achievements for review.
Login to iTunes Connect
Click on “My Apps”
Select your app
Click on “Game Center”
Complete the Leaderboards and Achievements set up
Select “Done”
Once you’ve completed all changes, click the “Submit for Review” button at the top of the App Details page.
Alternatively, if you do not wish to include Leaderboards and Achievements:
- Click the “Disabled/Enabled” button under “Game Center”
- Revise your Application Description, What’s New info, previews and/or screenshots to remove any content that refers to the Game Center feature(s).
ok, after contact with Apple, they have now passed my app's submission. No changes required. Game centre can be used without adding leaderboard or achievement if you are using multiplay compatibility.

Game Center Leaderboard score only updates when app resumes

I've got a Game Center leaderboard in my game that I display using my own GUI using data retrieved from the GKLeaderboard loadScoresWithCompletionHandler method.
I report new scores using the GKScore reportScoresWithCompletionHandler method. My issue is that when I report a new high score for the local player, when I open up my leaderboard GUI (which forces loadScoresWithCompletionHandler to be called), the player score isn't updated - it's displaying the old one he just beat.
But if I close(not kill) the game and then reopen it and open up the GUI again, hey-presto, the new score is shown.
This tells me that there must be some form of internal caching going on in GameKit that gets reset when the app resumes. I do know that upon the app resuming, GC calls my authenticationHandler to let me know that it has re-authenticated the player so maybe something in that method wipes whatever internal cache is set?
This is the first game I've worked on where I am displaying Game Center data using a custom UI and not the native GC view controller which I've never had this problem with. Has anyone had similar experience with this and could tell me why GKLeaderboard loadScoresWithCompletionHandler gives me old data?
I was having the same issue and it gave me sleepless night especially seeing no answer related to it on stackoverflow and other forums.
Then, i found somewhere that they were reporting new score whenever the level gets completes. And I changed the button from submit leaderboard to show leaderboard, it resolved the issue. I am using GC view controller. and i was only calling showleaderboard as it was a non-custom leaderboard.

Life cycle of repeatable Game Center achievements?

I am trying to understand the life cycle of repeatable Game Center achievements (those that have replayable set in GKAchievableDescription) based on what (little) information there is in Apple's Game Center Programming Guide.
Consider e.g. a repeatable achievement "FullCircle". My assumption is that a valid sequence could consist of the following steps:
app calls loadAchievementsWithCompletionHandler:, receives GKAchievement with [achievement.identifier isEqual:#"FullCircle] && (achievement.percentComplete == 0)
user finishes half circle for the first time
app sets achievement.percentComplete = 50 and calls reportAchievements:withCompletionHandler:
iOS Game Center app shows achievement as incomplete (sic!)
user finished full circle for the first time
app sets achievement.percentComplete = 100 and calls reportAchievements:withCompletionHandler:
iOS displays notification banner
iOS Game Center app shows achievement as complete
user finishes half circle for the second time
app sets achievement.percentComplete = 50 (sic!, not: 150) and calls reportAchievements:withCompletionHandler:
iOS Game Center app shows achievement as complete (sic!, because this is the second time)
user finished full circle for the second time
app sets achievement.percentComplete = 100 (sic!, not: 200) and calls reportAchievements:withCompletionHandler:
iOS displays notification banner
iOS Game Center app shows achievement as complete
loadAchievementsWithCompletionHandler: still reports only one (sic!, not: two) achievements for "FullCircle"
Does this make sense or am I making any wrong assumptions in this sequence? And is there any way for inquiring from Game Center how often an achievement such as "FullCircle" was earned?

Any way to re-show Game Center login view? (Xcode)

My app attempts to log the player in when it finishes loading, like good little apps should (so says Apple). But if the player chooses to cancel the initial log-in, I wanted the app to re-attempt to authenticate the player if the player taps the leaderboard button in the game. (otherwise, of course, the button couldn't do anything if the player is not authenticated)
Unfortunately, after some research I discovered that Apple does not seem to allow an app try again to re-authenticate the player after the player cancels the first time, until the player exits and re-enters the game. (If the player cancels three or so times, Apple goes aggro and disables Game Center from the app on that device entirely. Even logging into Game Center from the stand alone app won't help after that point.)
Is there any way around this so that my app can attempt the authentication both when the app loads, and any time the player taps leaderboard button while not logged in? Or do I just have to have my leaderboard button display a message when not authenticated saying that Apple's being dumb and overprotective and not letting my app respond the way it should? (Perhaps not quite in those words...)
I've used an alternative approach that might solve your requirement. When they tap on the leaderboard, check the Game Center connection state.
If it is not GCPConnectionStateEnabledFully then throw up an alert like this "Error connecting to Game Center. Please make sure you are signed into Game Center and check your internet connection". Then inevitably they will leave your app to check and when they return the Login prompt will appear a few seconds after they return to the app.
Testing note: When you are testing these scenarios you might cancel the login prompt 3 times. If you do that it will stop prompting you altogether and you need to reset all settings in the Settings app. I remember this being really frustrating.

Resources