question

Adam Brzozowski avatar image
Adam Brzozowski asked

Get CustomID

Is there a way to retrieve the CustomID? 

I am trying to resolve a situation where you could recover your account on a different device using GameCenter. But I also don't want you to be required to play the game if you do not have gamecenter. So the logic would be if you have a GameCenter see if user exists on PlayFab linked to that game center. If so pull down the CustomID that was linked when the account was created. They may sound a little convoluted but I have an entire workflow thought out for this and am trying to fit playfab into the flow.

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

We have a backlog item to add the CustomID to the returned data from the call to GetAccountInfo/GetUserAccountInfo/GetUserCombinedInfo. We don't have this work scheduled as yet, but what is your planned shipping date (if this is sensitive, please feel free to email us at devrel@playfab.com)?

10 |1200

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

Esteban Feldman avatar image
Esteban Feldman answered

@Brendan Was this resolved? I can't find the answer. Thanks.

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.

brendan avatar image brendan commented ·
0 Likes 0 ·
Greg Quinn avatar image Greg Quinn brendan commented ·
@Brendan Why does result.InfoResultPayload.AccountInfo.CustomIdInfo.CustomId give a null ref exception in Unity SDK when trying to call it from the LoginResult?
var request = new LoginWithCustomIDRequest() {CustomId = playerId, CreateAccount = true};

PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailed);private void OnLoginSuccess(LoginResult result)
{
PlayerPrefs.SetString("PlayFabCustomId", result.InfoResultPayload.AccountInfo.CustomIdInfo.CustomId);
}

Otherwise, how can I get the customId from the LoginResult?

0 Likes 0 ·
brendan avatar image brendan Greg Quinn commented ·

As with the Get...Info calls, we're only returning the account info that's specifically requested. If you want to get the Custom ID returned in the body of the response to a call to LoginWithCustomId, you'd have to specify that by setting GetUserAccountInfo to true in the InfoRequestParameters of the call.

2 Likes 2 ·

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.