How do I use Cognito to update user pool attributes with android?

南楼画角 提交于 2021-02-17 06:16:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!