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.
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.
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.
19 People are following this question.