question

Laarni avatar image
Laarni asked

Retrieve the versions with GetPlayerStatisticVersions.

Hi. I am trying to retrieve the previous versions of a statistic so i can check it when the game load and reset the highest score made to 0 for the new contest since the leaderboard is being reset daily. The ios SDK does not include that call so i added it. It is being called but it always return an error saying that " A statistic does not exist with the specified ID or name ". According to the documentation only one String is required wich is the StatisticName.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The problem in this case is that you're passing in an array of strings for StatisticName, where it only accepts a string. I've confirmed that passing in an array that happens to contain a string that matches a statistic for your game will indeed give that exact error. Can you try changing that to a string and re-testing? I'll open a bug to specifically check for that being passed in, so that we can have a more specific error message for that situation.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Laarni avatar image Laarni commented ·

Just tried to pass it as a String and the result is the same.

0 Likes 0 ·
brendan avatar image brendan Laarni commented ·

What are the specific parameters you are passing in to your title? Also, what are the results you get if you try the same call in Postman?

0 Likes 0 ·
Laarni avatar image Laarni commented ·

Fixed the problem. I rechecked my whole modification of the new call that i added and found out that my Json String was not set on the proper class. Now the call is made perfectly and the versions are returned so i can check the last one to reset the last best score of each player. Your answers lead me to check that the parameters that i am passing are not good so i dug in there. Thank you so much.

0 Likes 0 ·
brendan avatar image
brendan answered

What API call are you making, and what are the parameters you're passing into it? Also, what Title ID is this you're making the call on, and what PlayFab ID are you using for the test?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Laarni avatar image
Laarni answered

Here are the details:

API call: I basically took the API call from GetPlayerStatistics in the SDK for ios and made some modifications to have the right parameters sent and results received.

GetPlayerStatisticVersionsRequest* requestVersion = [GetPlayerStatisticVersionsRequest new];

    NSArray *statNameVersion = @[@"Stars"];

    requestVersion.StatisticName = statNameVersion;

    [[PlayFabClientAPI GetInstance]

     GetPlayerStatisticVersions:requestVersion success:^(GetPlayerStatisticVersionsResult *result, NSObject *userData) {

         NSLog(@"The versions are:%@",result.StatisticVersions);

     } failure:^(PlayFabError *error, NSObject *userData) {

         NSLog(@"%@", error.errorMessage);

     } withUserData:nil];


Parameters: StatisticName according to the Documentation.

Title ID: 8A21

PlayFab ID used for the test:

1~9AF50E2FA1855533
2~E2FD9BCF6CCA933E

Here is the debug console message:

A statistic does not exist with the specified ID or name

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.