Leaderboard/achievements and testing

Hi,

I created a leaderboard in my application, and a method to record a new score:

        
        GKLeaderboard.loadLeaderboards(IDs: [leaderboardID]) { (leaderboards, error) in
            if let error = error {
                print("Error loading leaderboards: \(error.localizedDescription)")
            }
            
            guard let leaderboard = leaderboards?.first else {
                print("Leaderboard not found")
                return
            }
            
            leaderboard.submitScore(score, context: 0, player: self.localPlayer) { error in
                if let error = error {
                    print("Error reporting score: \(error.localizedDescription)")
                } else {
                    print("Score reported successfully!")
                }
            }
        }
    }

When debuging, this method is correctly called and I have a success, so I tried to test it with an internal TestFlight release.

The leaderboard is never updated.

Is there a way to perform a test of a leaderboard before publishing the app?

I have the same question for achievements:

        let achievement = GKAchievement(identifier: identifier)
        achievement.percentComplete = percentComplete
        GKAchievement.report([achievement]) { error in
            if let error = error {
                print("Error reporting achievement: \(error.localizedDescription)")
            }
        }
    }

Thanks!

Can you clarify what you mean by internal TestFlight release?

Rico

WWDR - DTS - Software Engineer

Hi, In my Xcode Cloud build workflow, this is called: "TestFlight Internal Testing' Thanks. I install it using TestFlight. It has the same behaviour when I debug it on my phone. Thanks.

Leaderboard/achievements and testing
 
 
Q