The issue with the GetLeaderboardEntriesRequest is actually quite a simple one. You have been sending the request with the player field set as an empty string, "". This is essentially telling the request to look for a player with the ID "" and return their entry in the leaderboard. No player can have that as a userId so no entry is returned. If you simply remove that line altogether from the request in the test harness it will work as expected. Removing that line will get the entry for the current player. You only need to use that line if you want to specify the user who's entry you want to retrieve from the leaderboard. If you put quotes around High_Score_Leaderboard in Unity that should work. We do have a Unity Leaderboard tutorial which may point you in the right direction. You can find it here. If you have any other questions after going through that just let us know.
Have you made sure that the player sending the request actually has a score in the leaderboard ? That response would lead me to believe the player didn't have an entry in the given leaderboard.
Another problem is that I don't understand how to retrieve it from C# (Unity)
i tried this code but does not recognize the leaderboard short code
public void GetScore() //Score e rank
{
Debug.Log("Fetching score and rank Details...");
new GetLeaderboardEntriesRequest()
.SetLeaderboards(High_Score_Leaderboard)
.Send((response) => {
if (!response.HasErrors)
{
Customer Support
said
about 6 years ago
Answer
Hi Fabio,
The issue with the GetLeaderboardEntriesRequest is actually quite a simple one. You have been sending the request with the player field set as an empty string, "". This is essentially telling the request to look for a player with the ID "" and return their entry in the leaderboard. No player can have that as a userId so no entry is returned. If you simply remove that line altogether from the request in the test harness it will work as expected. Removing that line will get the entry for the current player. You only need to use that line if you want to specify the user who's entry you want to retrieve from the leaderboard. If you put quotes around High_Score_Leaderboard in Unity that should work. We do have a Unity Leaderboard tutorial which may point you in the right direction. You can find it here. If you have any other questions after going through that just let us know.
Thanks,
Liam
M
Mohamed Adel
said
almost 5 years ago
Hi,
Like Fabio said, how to get leaderboard entries. if i have some data inside the leaderboard array how to map it in c#.
Fabio Polentini
Hi,
Someone can explain me how to take the player information from the ledearboard (GetLeaderboardEntriesRequest) ?
I'm trying it on Test Harness and Unity,but I can not get the data.
On Test Harness on the leaderboards field should I insert the Leaderboards Short Code?
this is the result:
Thanks
Fabio
Hi Fabio,
The issue with the GetLeaderboardEntriesRequest is actually quite a simple one. You have been sending the request with the player field set as an empty string, "". This is essentially telling the request to look for a player with the ID "" and return their entry in the leaderboard. No player can have that as a userId so no entry is returned. If you simply remove that line altogether from the request in the test harness it will work as expected. Removing that line will get the entry for the current player. You only need to use that line if you want to specify the user who's entry you want to retrieve from the leaderboard. If you put quotes around High_Score_Leaderboard in Unity that should work. We do have a Unity Leaderboard tutorial which may point you in the right direction. You can find it here. If you have any other questions after going through that just let us know.
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Fabio,
Have you made sure that the player sending the request actually has a score in the leaderboard ? That response would lead me to believe the player didn't have an entry in the given leaderboard.
Thanks,
Liam
Fabio Polentini
Sure,
Another problem is that I don't understand how to retrieve it from C# (Unity)
i tried this code but does not recognize the leaderboard short code
public void GetScore() //Score e rank
{
Debug.Log("Fetching score and rank Details...");
new GetLeaderboardEntriesRequest()
.SetLeaderboards(High_Score_Leaderboard)
.Send((response) => {
if (!response.HasErrors)
{
Customer Support
Hi Fabio,
The issue with the GetLeaderboardEntriesRequest is actually quite a simple one. You have been sending the request with the player field set as an empty string, "". This is essentially telling the request to look for a player with the ID "" and return their entry in the leaderboard. No player can have that as a userId so no entry is returned. If you simply remove that line altogether from the request in the test harness it will work as expected. Removing that line will get the entry for the current player. You only need to use that line if you want to specify the user who's entry you want to retrieve from the leaderboard. If you put quotes around High_Score_Leaderboard in Unity that should work. We do have a Unity Leaderboard tutorial which may point you in the right direction. You can find it here. If you have any other questions after going through that just let us know.
Thanks,
Liam
Mohamed Adel
Hi,
Like Fabio said, how to get leaderboard entries. if i have some data inside the leaderboard array how to map it in c#.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics