user513064
user513064

Reputation:

Game Center Achievement Issue

I have recently decided to add achievements to a game that has been on the App Store for years now, and I'm having issues with making them work.

I am using the following code to post the achievements:

GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier: identifier];

[achievement setPercentComplete:100.0];

[GKAchievement reportAchievements:@[achievement] withCompletionHandler:^(NSError *error){

}];

But reportAchievements just logs no bundle for bundleID: (null).

I'm wondering if it has something to do with the fact that achievements aren't live yet and Apple has removed sandbox servers. But they are registered in iTunes Connect and I'm using a Test User.

It is also important to note that this app was transferred from a different developer.

For the app ID I tried using:

The leaderboard that has been present since before the transfer is still working and it uses the old developer's ID.

I even tried just getting a list of all achievements using the code in the first answer here, but it still says no bundle for bundleID: (null).

EDIT:

I found that even though it says no bundle for bundleID: (null), it still correctly returns a list of all achievements. I assume that this message is just some glitch in the system and that it works anyway.

That said, I am still unable to make achievements unlock using any combination of ID.

Upvotes: 16

Views: 2800

Answers (3)

davsto
davsto

Reputation: 532

I received the same error message while accidentally trying to report an achievement within my app that was not configured in iTunes Connect.

So, the following steps might help you:

  1. Check iTunes Connect for missing achievements
  2. Check your achievement ids for spelling mistakes

Upvotes: 0

Kumar Utsav
Kumar Utsav

Reputation: 2841

I faced the same issue. Stepping cautiously through my code in my debugger, I came to figure out if I use GKScore instead of GKAchievement , the warning message disappears. So thumb rule is check your achievements and leaderboards. Go with GKScore instead of GKAchievement.

[ GKAchievement reportAchievements:achievements withCompletionHandler:^(NSError *error) {
    if ( error != 0 )
        NSLog( @"Reporting of %@ failed: %@", achievement, [ error localizedDescription ] );
}];

You can also see the radar. It is with no. rdar://23149890

Upvotes: 1

mginn
mginn

Reputation: 16124

For me the problem was that the achievement was being unlocked, but not displaying. I don't know of any way to not display the message, but it is harmless.

Upvotes: 1

Related Questions