Hi I am trying to implement email verification on signup. I am following this guide for that
But the problem is I am not getting the verification email while I signup. Also I saw that the contact email is getting added but the verification status is "Unverified".Also no events are triggered in the Playstream.
What I am doing is as soon as I signup the player , I am adding the contact email of the player as well. But I don't understand why is it that I am not getting the confirm email link as such.
Here is the code:
public void SignUpButton() { var request = new RegisterPlayFabUserRequest { Username = UserNameInput.text, Email = emailInput.text, Password = passwordInput.text, }; PlayFabClientAPI.RegisterPlayFabUser(request, OnSignUpSuccess, OnError); }
So when the signup button is pressed the above function gets executed. In the OnSignUpSuccess function:
private void OnSignUpSuccess(RegisterPlayFabUserResult result) { StartCoroutine(WaiterOnSignUpSuccess()); }
Now as per the documentation I have written the following code:
void AddContactEmailToPlayer(string userName, string emailId) { var loginReq = new LoginWithCustomIDRequest { CustomId = userName, // replace with your own Custom ID CreateAccount = true // otherwise this will create an account with that ID }; var emailAddress = emailId; // Set this to your own email PlayFabClientAPI.LoginWithCustomID(loginReq, loginRes => { Debug.Log("Successfully logged in player with PlayFabId: " + loginRes.PlayFabId); AddOrUpdateContactEmail(emailAddress); }, FailureCallback); } void AddOrUpdateContactEmail(string emailAddress) { var request = new AddOrUpdateContactEmailRequest { EmailAddress = emailAddress }; PlayFabClientAPI.AddOrUpdateContactEmail(request, result => { Debug.Log("The player's account has been updated with a contact email"); }, FailureCallback); } void FailureCallback(PlayFabError error) { Debug.LogWarning("Something went wrong with your API call. Here's some debug information:"); Debug.LogError(error.GenerateErrorReport()); MessageFormatter(error.ErrorMessage); } }
I dont know whether I did something wrong with the email and custom-ID link. I changed the custom ID link which you get at the end of step 1 but no use. Also it was mentioned that what ever ID you obtain there will be used in step 4, but I see it not being used anywhere.