下面是使用由杰夫sugested的link一个完整的示例:
CognitoUserAttributes attributes = new CognitoUserAttributes();
attributes.addAttribute("phone_number","+15555555555");
attributes.addAttribute("email","[email protected]omain.com");
cognitoUserPool.signUp('username', 'password', attributes, null, new SignUpHandler() {
@Override
public void onSuccess(CognitoUser cognitoUser, boolean b, CognitoUserCodeDeliveryDetails cognitoUserCodeDeliveryDetails) {
// If the sign up was successful, "user" is a CognitoUser object of the user who was signed up.
// "codeDeliveryDetails" will contain details about where the confirmation codes will be delivered.
}
@Override
public void onFailure(Exception e) {
// Sign up failed, code check the exception for cause and perform remedial actions.
}
});
的部分使用用户池与移动SDK的例子对于Android似乎已过时。
希望能帮助别人;)
嗨杰夫感谢您的回答。该示例在步骤3:为用户注册您的应用程序。 –