I don't know if this is still relevant, but here is how to accomplish the task with Amplify.
First you build an AuthSignUpOptions object (example of custom attribute and standard attribute below):
AuthSignUpOptions options = AuthSignUpOptions.builder() .userAttribute(AuthUserAttributeKey.custom("custom:role"), "some_role") .userAttribute(AuthUserAttributeKey.address(), "some_address") .build();
Then call Amplify.Auth.signup:
Amplify.Auth.signUp("username", "password", options, result -> { /* do something */ }, error -> { /* do something */ });
Altogether it looks like this:
AuthSignUpOptions options = AuthSignUpOptions.builder() .userAttribute(AuthUserAttributeKey.custom("custom:role"), "some_role") .userAttribute(AuthUserAttributeKey.address(), "some_address") .build(); Amplify.Auth.signUp(tempUsername.getText().toString(), pin.getText().toString(), options, result -> { /* do something */ }, error -> { /* do something */ });