question

luizcarlos-bs avatar image
luizcarlos-bs asked

I need to get CustomId from PlayfabId, and see if the logged player has any CustomId. Also I need to get Email and see if the player logged by CustomId have any Email linked.

1 comment
10 |1200

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

luizcarlos-bs avatar image luizcarlos-bs commented ·

What I'm trying to do is:
I have one way to register user with CustomId non anonymously.

After register my CustomId, I want to check if the Player have Email and Password set, if doesn't I want to AddUsernamePassword.

I also have one way to register user with Email and Password, but I want to check if the Player have any CustomId, so if doesn't, go to linkCustomId

I already can Register with CustomId, Register With Email and Password, and Link Custom Id on Account that has Email and Password, as I can Add Username Password and Email in one Account with CustomId.
What I can't and need help so bad, is check if the account have Email and Password and check if have CustomId, so I can push the user to register missing information.
I'm using Unity, to it's C# code.

0 Likes 0 ·

1 Answer

·
Neils Shi avatar image
Neils Shi answered

According to your description, you can use the PlayFab API GetAccountInfo to check if the account has Email and Password or has CustomId. You can check the response: UserAccountInfo to see if CustomIdInfo(CoustomId) and PrivateInfo(Email) exists.

2 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.

luizcarlos-bs avatar image luizcarlos-bs commented ·

Thank you, now I can get the info I need, but I'm with one anoying bug.

When my user doesn't have any CustomId, how can I pass that info?

I tried this:

I have my public Text CustomIdString;

if(result.AccountInfo.CustomIdInfo.CustomId != null){

 CustomIdString.text = result.AccountInfo.CustomIdInfo.CustomId; 

} 

else { 

CustomIdString.text = "null"; 

}

But this happens:

NullReferenceException: Object reference not set to an instance of an object


When my user has CustomId, everything works fine.

1 Like 1 ·
Neils Shi avatar image Neils Shi luizcarlos-bs commented ·

Since you asked the same question in another post, I will answer this question in that post.

1 Like 1 ·

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.