问题
I'm making an android app and have created a user in my user pool with the Amplify framework. The documenation for amplify says that making calls to get/set attributes isn't built yet, so I guess I need to use cognito directly. I now want to set attributes such as name once the user signs up.
Right now I have this code, but I'm not sure what to do from here.
CognitoUserAttributes attributes = new CognitoUserAttributes();
attributes.addAttribute("testAttribute", "testValue");
Also I'm struggling to figure out how to use cognito in android, the only documentation I can find is this: https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index-all.html
回答1:
This functionality has not yet been implemented in Amplify for Android but is scheduled to be finished in the near future, as noted in this documentation. Please check back to the documentation for updates on availability.
In the meantime though, you can still use Amplify. Just access the underlying AWSMobileClient through the authentication escape hatch, which does support passing custom attributes. See this documentation for more details on how exactly to use AWSMobileClient.
来源:https://stackoverflow.com/questions/63392996/how-do-i-use-cognito-to-update-user-pool-attributes-with-android