iOS 8, Unity 5.1.1 and Social API

Am I missing something here?

public override void BeginReportAchievementCompleted(stringachievementId) {
Debug.Log(GetType().ToString() + ": BeginReportAchievementCompleted(" + achievementId + ")");

GameCenterPlatform.ShowDefaultAchievementCompletionBanner = true;

Social.ReportProgress(achievementId, 100.0, (bool success) => {
    if (success) {
        Debug.Log (GetType().ToString() + ": Achievement " + achievementId + " successfully reported.");
     }
    else {
        Debug.Log (GetType().ToString() + ": Failed to report achievement " + achievementId + ".");
     }
});
}

My log shows the “BeginReportAchievementCompleted” line. It does not show either of the callback’s log messages. There’s also no error in the log. Nothing shows up in the Game Center app as completed. No banner appears.

Similarly, submitting a score to a leaderboard yields no result.

Getting scores from a leaderboard gives me the following:

The operation couldn’t be completed. (Cocoa error 4099.)

When my app starts the sandbox account logs in correctly.

In Settings on my iPad I have Sandbox enabled and am logged into one of the sandbox user accounts created in iTunes Connect.

Before I updated to iOS 8 the leaderboards definitely worked, and I haven’t changed that code since then. I can’t remember if I was using Unity 4 or 5 at the time.

Something potentially worth note is that when I look at the game in Game Center it does show one logged high score, from the sandbox user I used to test it way back when I first implemented it. That user was created the old way, when you made sandbox users from the login process in game rather than in iTunes Connect. iTunes Connect does not show that user. So I wonder if this is all because the back end is messed up?

Any ideas would be sweet.

Nobody? Nothing?

Edit: Ack! Looks like the most recently added line in there is an error. ShowDefaultAchievementCompletionBanner is a function, not a property. That doesn’t explain why it didn’t work before I added that, but it’s hopefully a step in the right direction.

Alrighty, back at it.

I’m now getting log messages indicating a failure when BeginReportAchievementCompleted is called. That’s a good start.

Looking further, there’s something odd. The GameCenter UI is telling me that I’ve logged in successfully, but the log says Unity thinks otherwise - user authentication fails, which is most likely the cause of everything else. I’m looking into the cause of this now.

Edit: Installed TestFlight, after reading that it’s required even if you’re not using it. I also removed the app and hard-reset the device before re-deploying. The authentication callback now gets hit twice - once with a fail before the Game Center UI appears for login, and then once with a success after the login process is complete!

Scores submit successfully. Scores sort of download successfully (the board doesn’t appear to have been updated recently at all). Achievement reporting still fails.

Edit: Creating and using an ILeaderboard makes that work as expected. I was going to have to do that anyway to set the scope and such, and it could have just been some other default setting that wasn’t as I wanted in the first place.