电子邮件和手机的 AWSCognito 验证码传送 iOS

AWSCognito Verification Code delivery for both email and Mobile iOS

我们正在为我们的 iOS 应用开发 AWS Cognito。在 SignUp 期间,我仅通过短信获得验证码(我在 SignUp 期间同时提供了电子邮件和手机输入)。 有什么方法可以 同时获取(短信和电子邮件)验证码。如果可能的话,让我们知道如何获得它。

谢谢。

如果同时提供 phone 和电子邮件,则仅发送短信代码。要验证电子邮件,您需要执行以下操作:

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.

如此处指定:Specifying User Pool MFA Setting and Email and Phone Verification Settings