Problem with Game Center achievements

I’m trying to implement achievements in my iOS game using Game Center and the Social API. I have 6 achievements registered on iTunes Connect as can be seen in the image below. However, when I call Social.ReportProgress with the Achievement ID, progress percent, and callback, it always fails to report it successfully and logs the error “Achievement ID not found”. I’ve noticed that while Social.LoadAchievements will return 0 results, Social.LoadAchievementDescriptions will return 3 descriptions named “Achievement01” etc.

Here is my code:

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SocialPlatforms;
using UnityEngine.SocialPlatforms.GameCenter;
using System.Collections;

public class GameCenter : MonoBehaviour {

    void Start () {
        if(!Social.localUser.authenticated)
            login ();
        GameCenterPlatform.ShowDefaultAchievementCompletionBanner(true);
        Social.ReportProgress("World1", 100, load);
    }

    void login() {
        Social.localUser.Authenticate (success => {
            if (success) {

                //Log user information
                Debug.Log ("Authentication successful");
                string userInfo = "Username: " + Social.localUser.userName +
                    "\nUser ID: " + Social.localUser.id +
                        "\nIsUnderage: " + Social.localUser.underage;
                Debug.Log (userInfo);

                //Log description information
                Social.LoadAchievementDescriptions (descriptions => {
                    if (descriptions.Length > 0) {
                        Debug.Log ("Got " + descriptions.Length + " achievement descriptions");
                        string achievementDescriptions = "Achievement Descriptions:\n";
                        foreach (IAchievementDescription ad in descriptions) {
                            achievementDescriptions += "\t" +
                                ad.id + " " +
                                    ad.title + " " +
                                    ad.unachievedDescription + "\n";
                        }
                        Debug.Log (achievementDescriptions);
                    }
                    else
                        Debug.Log ("Failed to load achievement descriptions");
                });

                //Log achievement information
                Social.LoadAchievements (achievements => {
                    if (achievements.Length == 0)
                        Debug.Log ("Error: no achievements found");
                    else
                        Debug.Log ("Got " + achievements.Length + " achievements");
                });
            }
            else
                Debug.Log ("Authentication failed");
        });
    }

    void load(bool result){
        if(result){
            Debug.Log ("Successfully reported progress");
        } else {
            Debug.Log ("Failed to report progress");
        }
    }
}

I always seem to successfully login, but it doesn’t know that my achievements are there. If anyone has more experience with the Social API, help would be greatly appreciated.

1 Like

I have the same issue. Working on it right now and looking for answers. Will keep you posted if I find answers somewhere else.

Same problem here. If anyone finds a solution, please post it here. This is the only thing holding up the submission of my game and it is quite frustrating.

I submitted my app to Apple without Game Center in this version. Considering all the examples and assets I saw did it the exact same way and also failed, I’m assuming it’s a bug in the way Unity 5 handles Game Center in iOS 8.

Prime31 makes a Game Center plugin, and their website notes that there is a bug with GameKit in Unity 5, but even after following their workaround, it still didn’t work for me.

I also have an asset in the Asset Store for Game Center. It is actually the #1 search result for game center: https://www.assetstore.unity3d.com/en/#!/content/16887

Obviously, this is extremely frustrating in regard to my own games, and for people who buy my asset. I really hope this gets fixed asap =/

Oh also - It is actually not just in regard to iOS 8. My iPod Touch 5th gen is running iOS 7 with the same result.

Just to verify with you guys.

If I call Social.LoadAchievementDescriptions I get a listing with all of my achievements as I have configured them on Itunes Connect with correct Id’s.

So this shows that the achievements have been setup on the servers correctly.

It is just when I call ReportProgress with those same Id’s things return a failed result.

Looking at the console output from xcode. I get something that looks like this when I try to ReportProgress.

Looking for CgkIuLudmpkHEAIQCw, cache count is 0
Unlock result: False

Correct. On my end, what I am seeing is this:

-I can open and view GC correctly inside the game
-Leaderboards work perfectly, and scores are reporting correctly
-I can correctly see a list of all achievements in GC, however:
-I cannot report an achievement correctly. It always returns false, no matter what

Anyone made any progress?

1 Like

Not yet. I am trying to find a way to receive the error message instead of a true/false value.

Same here - I will make sure to post if I succeed.

Can’t figure out how to run the debugger on the native DLL running the Game Center code… Sort of stuck at this point.

I’m stuck at the same point, which is unfortunate. My game just reached 100k downloads and I have been preparing a giant update adding a lot of features and play modes as the game just keeps getting lots of downloads.

I guess I will just submit without achievements for now. This is disappointing as the new update has a virtual currency (gold) that the player uses to unlock different weapons. Unlocking each weapon completes an achievement. When the user uninstalls the game and then re-installs it later - if that achievement is complete then their weapon is once again unlocked. I use this method instead of keeping up with user accounts and player unlock progression on my own server.

Ah well… I’ll just get another update out as soon as Unity fixes this. Aside from this issue, I am quite loving Unity 5. Good job Unity team =)

But please get this fixed ASAP! =D

Is there any progress on this issue?

Hey,

In the end I switched to using the Prime31 Gamecenter plugin prime31 - Unity plugin and asset documentation

Everything worked after this without any changes to Itunes Connect.

I am guessing there is a bug in the Unity built in stuff.

I have the same frustrating issue here,

I can get the listing of all my achievements without issues but I am unable to get Social.LoadAchievements to work at all, is there any hope that this will be fixed soon or someone will find a fix ?

I just said if you use the Prime31 Gamecenter plugin you can get achievements to work. Read the whole thread.

I read the whole thread and the whole point is to be able to use an actual feature from the engine, not to have to use a costly third party plugin that will do the exact same thing.

2 Likes

Just so you know bufbot. The expensive plugin isn’t exactly the same as the built in. It is a lower level API and you can get a bit more debug error info back if you are having issues.

But yes it would be nice if the builtin stuff works. Bit dissapointing.

I have the same issue, even after update to Unity 5.0.1, after report progress returns false and I get log:

Looking for CgkI97W8sPQTEAIQBA, cache count is 1

Have anybody found a workaround?