下面是使用由傑夫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:爲用戶註冊您的應用程序。 –