Search code examples
iosobjective-camazon-web-servicesamazon-cognito

AWSCognito Verification Code delivery for both email and Mobile iOS


We are working on AWS Cognito for our iOS app. While during SignUp I got verification code only via sms(I gave both email and mobile inputs during SignUp). Is there any way to get the verification code on both(sms and email). If possible, let us know how to get that.

Thanks.


Solution

  • If both phone and email are provided only the SMS code is sent. To verify the email you need to do the following:

    If a user signs up with both a phone number and an email address, and your user pool settings require verification of both attributes, a verification code is sent via SMS to the phone. The email address is not verified. Your app can call GetUser to see if an email address is awaiting verification. If it is, the app should call GetUserAttributeVerificationCode to initiate the email verification flow and then submit the verification code by calling VerifyUserAttribute.

    As specified here: Specifying User Pool MFA Setting and Email and Phone Verification Settings