我在Flutter中使用Amplify/Cognito来处理用户身份验证流程。我可以更新和重置用户密码。但是我不知道如何更改用户的电话号码。
是否可以更新用户电话号码?我当前使用这些包: amplify_auth_cognito:^0.1.0 amplify_flutter:^0.1.0
谢谢。
发布于 2021-06-07 21:25:09
将软件包从0.1.0更新到1.0.5
dependencies:
amplify_auth_cognito: ^0.1.5
amplify_flutter: ^0.1.5从1.0.5版开始,可以使用API来更新用户属性。Refer docs here
try {
var res = await Amplify.Auth.updateUserAttribute(
userAttributeKey: 'email',
value: 'email@email.com',
);
if (res.nextStep.updateAttributeStep == 'CONFIRM_ATTRIBUTE_WITH_CODE') {
var destination = res.nextStep.codeDeliveryDetails.destination;
print('Confirmation code sent to $destination');
} else {
print('Update completed');
}
} on AmplifyException catch (e) {
print(e.message);
}https://stackoverflow.com/questions/67140405
复制相似问题