question

jrDev avatar image
jrDev asked

GetUserPublisherDataRequest not in Unity3d Client SDK? [Solved]

Hello,

I am trying to make a GetUserPublisherDataRequest in Unity but it is not recognized. Am I missing something?

 

Thanks,

jrDev

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

That one can be a bit confusing. All the get user data API calls derive from the same base, and since they all take the same parameters, they all use GetUserDataRequest as their input. I'll ask the tools team to add some clarification to the SDK documentation on this.

10 |1200

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

jrDev avatar image
jrDev answered

Uh, what you are saying is that they pass back the same data?

Thanks,

jrDev

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

No, I was saying that in our SDKs, all GetUser...Data API (where the ellipsis replaces the details, like "Publisher" or "ReadOnly") calls use the same class for their request input: GetUserDataRequest. In other words, specific to your original question, there is no "GetUserPublisherDataRequest". You use GetUserDataRequest as the input to the GetUserPublisherData API call.

In response, they all return a GetUserDataResult, containing the data you've requested.

10 |1200

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

jrDev avatar image
jrDev answered

Hey,

I am still kind of lost, could you write an example code to use for this specific call?

Thanks,

jrDev

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

Actually, there's an example of GetUserData in the Unity SDK examples:

https://github.com/PlayFab/UnitySDK/blob/56b2daf8f1d2c5bb56fda287d2cde4da6f5d4038/PlayFabCombinedTestingSample/Assets/PlayFabSDK/Examples/API/Client/UserDataExample.cs

To make the call to any of the other user data types, you'd just change the call, but not the request type. So in other words, here's the call in the example:

public static void GetUserData()
{
var getRequest = new ClientModels.GetUserDataRequest();
getRequest.PlayFabId = PfSharedModelEx.globalClientUser.playFabId; // You may ask for yourself specifically, any other playFabId you're aware of, or null to default to yourself
// getRequest.Keys = new System.Collections.Generic.List<string>() { filterKey };
PlayFabClientAPI.GetUserData(getRequest, GetUserDataCallback, PfSharedControllerEx.FailCallback("GetUserData"));
}

To make this call for GetUserPublisherData, you could make it like so:

public static void GetUserPublisherData()
{
var getRequest = new ClientModels.GetUserDataRequest();
getRequest.PlayFabId = PfSharedModelEx.globalClientUser.playFabId; // You may ask for yourself specifically, any other playFabId you're aware of, or null to default to yourself
// getRequest.Keys = new System.Collections.Generic.List<string>() { filterKey };
PlayFabClientAPI.GetUserPublisherData(getRequest, GetUserPublisherDataCallback, PfSharedControllerEx.FailCallback("GetUserPublisherData"));
}

 

10 |1200

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

jrDev avatar image
jrDev answered

Now I understand. Solved!

 

Thanks,

jrDev

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.