Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by FfZ · Jan 23, 2014 at 10:18 AM · u3dxt

GameKit Authenticates but can't post scores to leaderboard

Hi there,

At the end of the level I am trying to post the score, then retrieve the top 10 scores via:

if (CoreXT.IsDevice) { GameKitXT.ReportScore(leaderboardID, Convert.ToInt64(myGUI.text)); //GameKit Reporting RetrieveTopTenScores(); }

I have confirmed that the leaderboardID is correct on iTunes. (I am using the leaderboard ID from iTunes, not the reference name). I have ensured that GameCentre is turned on for the app. In the app I can see local.auth happening correctly and I get a "Welcome Back XXX, Sandbox" Message. I have tried replacing the Convert.ToInt64(myGUI.text) with the int score variable.

Once I look on Ios7 game centre there are no scores associated with the leaderboard. The RetrieveTopTenScores is also not working as there are no scores to retrieve.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by FfZ · Jan 24, 2014 at 08:05 AM

Hi there,

Thank you for the prompt response ;) It appears as if the score is being reported , but there is nothing on game centre (sandbox ?)

Debug:

"Local Player authenticated G:1920xxxxxxx (numeric) "Local player has no photo or error loading photo" "Loaded friends" "Reported Score" "Error retrieving scores: The requested operations could not be completed because one or more of the parameters are invalid"

  • End of Debug --

void RetrieveTopTenScores() { GKLeaderboard leaderboardRequest = new GKLeaderboard(); if (leaderboardRequest != null) { // configure request leaderboardRequest.playerScope = GKLeaderboardPlayerScope.Global; leaderboardRequest.timeScope = GKLeaderboardTimeScope.AllTime; leaderboardRequest.category = leaderboardID; leaderboardRequest.range = new NSRange(1, 10);

         // load scores; it calls delegate back when done
         leaderboardRequest.LoadScores(delegate(object[] scores, NSError error) {
             if (error != null) {
                 Log("Error retrieving scores: " + error.LocalizedDescription());
             } else if (scores != null) {
                 
                 // got the scores, but the low-level GKScore only has player ID.
                 // if you want player display name, you need to combine it with
                 // the high-level API to load the players
                 string[] playerIDs = scores.Cast<GKScore>().Select(x => x.playerID).ToArray();
                 Player.LoadPlayersByIDs(playerIDs, delegate(Player[] players) {
                     
                     // print localized title of leaderboard
                     //Log("Top 10 for " + leaderboardRequest.title);
                     
                     for (int i=0; i<scores.Length; i++) {
                         GKScore score = scores[i] as GKScore;
                         Player player = players[i];
                         myLabel.text = (score.rank + ". " + score.formattedValue + ", " + score.date + ", " + player.displayName);
                     }
                 });
             }
         });
     }
 }
Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image u3dxt · Jan 24, 2014 at 05:51 PM 0
Share

Hi, it looks like your leaderboardID is not matching. I just tried an incorrect leaderboardID and it also says the score is reported, but it's actually not reported. Retrieving the scores also gives the same error as you did.

Can you make sure the public leaderboardID variable in the scene matches the string in the cs file? Or just to make sure, print it out when you use it.

avatar image FfZ · Jan 25, 2014 at 08:34 AM 0
Share

Hi there, I have called my $$anonymous$$erboard ID "Default". I then have printed it out whenever it is used and it comes back as "com.mdphillips.fb.Default" - $$anonymous$$y bundle ID is "com.mdphillips.fb" and my $$anonymous$$erboard Name is "$$anonymous$$ain" and id is "Default".

If I show the leaderboard in app it comes back with the right app name (mptestapp) but the leaderboard is blank.

Then when I pull the 10 top scores I get the same error as above?

avatar image FfZ · Jan 25, 2014 at 08:53 AM 0
Share

As a test I changed my leaderboard id to "$$anonymous$$ain" , I get the exact same results?

Now I'm really confused.

avatar image u3dxt · Jan 26, 2014 at 12:31 AM 0
Share

Hi, the leaderboard ID should match exactly what you put in iTunesConnect for your game. If you put "Default" in iTunesConnect without the bundle ID, you should use just "Default". However, we recommend using the bundle ID as prefix in iTunesConnect. Also, sometimes changes in iTunesConnect don't get reflected immediately -- takes some time ($$anonymous$$utes or even tens of $$anonymous$$utes). Hope this helps.

avatar image FfZ · Jan 26, 2014 at 06:25 AM 0
Share

That was it! Thanks, great support and great plugin.

avatar image
0

Answer by u3dxt · Jan 23, 2014 at 04:53 PM

Hi FfZ, can you subscribe to GameKitXT.ScoreReported and ScoreReportedFailed events and print out e.description on error?

You should also call RetrieveTopTenScores() after ReportScore() is completed. ReportScore() is an async method, and dispatches one of the above two events when completed.

Also, the Game Center app may not show your sandbox games. You can however, show it within your game by calling GameKitXT.ShowLeaderboard(leaderboardID).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by FfZ · Jan 24, 2014 at 08:05 AM

Hi there, I have also executed the GameKitXT.ShowLeaderboard(leaderboardID) and it comes back with an empty leaderboard?

thanks,

Mark

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How Do I Get Support for U3DXT's iOS SDK Plugin? 6 Answers

Significant-Change Location Service App Wakeup 1 Answer

Unable to import iOS SDK Essentials with only core features selected 1 Answer

U3DXT Webview GUILayout.Button Problem 0 Answers

iOS 8 location services not working 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges