I am new in PlayFab. I try to get user geo location. But I got error. And I really don't know how its work.
Here is my code.
string x;
private void Start()
{
getplayerlocation();
}
public void getplayerlocation()
{
PlayFabClientAPI.GetPlayerCombinedInfo(new GetPlayerCombinedInfoRequest()
{
PlayFabId = PlayerPrefs.GetString("playfabid"),
InfoRequestParameters = new GetPlayerCombinedInfoRequestParams { ProfileConstraints = new PlayerProfileViewConstraints { ShowLocations = true } },
}, onsuccess, onerror);
}
void onsuccess(GetPlayerCombinedInfoResult result)
{
List<LocationModel> a = result.InfoResultPayload.PlayerProfile.Locations;
foreach (var b in a)
{
x = b.CountryCode.ToString();
}
Debug.Log(x);
}
void onerror(PlayFabError error)
{
Debug.LogError(error.GenerateErrorReport());
}
This is the error