Search Unity

Server error when trying to load scores from recurring leaderboard (GameCenter)

Discussion in 'iOS and tvOS' started by adslitw, Jan 6, 2021.

  1. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    When I attempt to load scores from a recurring leaderboard using the Social APIs I get a server error:

    "Failed to load scores The requested operation could not be completed due to an error communicating with the server."

    When I use exactly the same code to load scores from a classic leaderboard it works fine so I'm confident my code is fine, and my leaderboard setup is fine.

    Has anyone else had issues loading scores from a recurring leaderboard?
     
  2. IndieMobileGames

    IndieMobileGames

    Joined:
    Nov 8, 2017
    Posts:
    12
    We also often faced issues like that. That's the reason why we developed our own server side leaderboard solution. Now we like to make it accessible for every one. Maybe you like to give it a try. You can find it here.
     
  3. VektaCo

    VektaCo

    Joined:
    Sep 30, 2019
    Posts:
    31
    *Bump whats the latest on this @ScottF
    It makes daily iOS scoreboards impossible to display in game.
     
  4. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Someone on the Prime31 forums posted this, which points out exactly what the problems is - TLDR the deprecated API no longer works. I'm guessing Unity uses the same deprecated API? Not sure who to ask re: this, maybe @JeffDUnity3D ?

    "I realise it's been a while, but this week I finally decided to write some of my own native code to try and debug this issue. I had similar issues with Apple where they would not refer me to the code-level support team.

    Querying scores for recurring leaderboard does in fact require usage of a different part of the API only available on IOS 14+. It also requires a slightly different flow which I'm assuming Prime31 currently does not utilise.

    To successfully query recurring leaderboard scores using native code we used the following functions:

    GKLeaderboard loadLeaderboardsWithIDs - This gave us a valid GKLeaderboard based on the recurring leaderboard name and gives us a gkLeaderboard object to work with.

    gkLeaderboard loadEntriesForPlayerScope - This loads our scores based on parameters provided and returned valid scores from the recurring leaderboard. (I'm now trying to work out how to serialize this to report back via Prime31 GameCenterManager, Objective C is such a pain)

    Both of these functions are IOS 14+ specific and using loadScoresWithCompletionHandler from the old deprecated API did not work.

    tl;dr Recurring leaderboards require IOS 14 and do not support queries from the old API. (Which I'm assuming Prime31 is using)"
     
  5. Deleted User

    Deleted User

    Guest

    Having the same issue. Kinda ridiculous!
     
  6. pandolfini

    pandolfini

    Joined:
    Feb 5, 2020
    Posts:
    17
    @JeffDUnity3D it would be great if you conveyed to people at Unity things like this. The entire market for Unity games is on the Apple App Store, and we need stuff like this to work. Main things you guys should focus on in the immediate term:

    (1) Get (buy) a proper leaderboard solution in Unity. Recurring leaderboards have existed for three years now and you can't pull data from them in Game Center. There's no discussion of this in docs.

    (1)(a)Bonus points if you can get a solution to work cross-platform for iOS and Android without Google Play Games, which is a huge hassle to get working, and without Game Center entirely. Provide a simple back-end, hell, even charge for it as a service if it's over a certain number of users, and get yourselves another revenue stream. People pay for useful things.

    (2) Also a @JeffDUnity3D special based on my reading of the forums: your codeless IAP solution doesn't work. I see your explanations on these forums, and I don't know what to tell you, but it either doesn't work or your docs don't explain how to make it work. This has been the case for at least the last five years. If there are some things you need to do to make codeless IAP work, run through a real project on your own, find the snags, and make it clear in the docs.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @pandolfini Have you submitted a bug? This thread is not my area. And you are mixing issues. But to your point regarding Codeless IAP, please see (all) my recent posts in the last several years on the use of Codeless IAP and my recommendations to get IAP working properly. I mention the same recommendation every time.
     
    spakment likes this.
  8. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    25
    Hey everyone. Currently we do not actively support our Social API / Game Center implementation. For the nearest future there are no plans to add recurring leaderboards. To use Game Center features I suggest using official Apple Game Kit plug-in for Unity.
     
    spakment likes this.
  9. spakment

    spakment

    Joined:
    Dec 19, 2017
    Posts:
    96
    @Petras-Unity Would you be able to put that recommendation (to use https://github.com/apple/unityplugins ) somewhere in the Unity docs? (would be great here: https://docs.unity3d.com/ScriptReference/Social.html )

    I've been revisiting the best approach and there is a lot of conflicting details for best approaches on iOS, the current details on the Social API in the docs, a blog post https://blog.unity.com/technology/support-for-apple-sign-in mentioning something that seems to be depreciated and the UGS cloud solution.

    Having looked thorugh the forums this page actually has the best advice! eg, use https://github.com/apple/unityplugins
     
  10. newtquestgames

    newtquestgames

    Joined:
    Mar 9, 2015
    Posts:
    11
    Can anybody get https://github.com/apple/unityplugins working on a windows machine in Unity?

    I follow the steps to build the apple unity plugin and then install the package into my project as a tarball on my windows dev machine. But I get lots of errors like this :

    Library\PackageCache\com.apple.unityplugin.core@077039b365c9\Editor\AppleBuildStep.cs(48,136): error CS0246: The type or namespace name 'PlistDocument' could not be found (are you missing a using directive or an assembly reference?)

    I've installed the iOS build target.

    Anybody else had success with the apple unity plugins on a windows machine or is it impossible?
     
  11. spakment

    spakment

    Joined:
    Dec 19, 2017
    Posts:
    96
    @newtquestgames I'm not sure that it'll work on a windows machine (it might though!)

    The PlistDocument is defined here https://docs.unity3d.com/ScriptReference/iOS.Xcode.PlistDocument.html in UnityEditor.iOS.Xcode, I can see at the top of the AppleBuildStep.cs script is has a conditional compilation of:

    Code (CSharp):
    1. #if UNITY_EDITOR_OSX
    2. using UnityEditor.iOS.Xcode;
    3. #endif
    you could try removing the OSX bit.. and swapping it to just
    Code (CSharp):
    1. using UnityEditor.iOS.Xcode;
    I'd guess they've locked it to OSX only though for a reason, likely some XCode only setup that is futher into the build process
     
    newtquestgames likes this.