问题描述
我正在制作一个android应用程序,并使用Amplify框架在我的用户池中创建了一个用户.domplify的文档显示尚未建立对get/set属性的调用,因此我想我需要直接使用cognito.现在,我想在用户注册后设置诸如名称之类的属性.
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");
我也正在努力弄清楚如何在android中使用cognito,我可以找到的唯一文档是: https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/index-all.html
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
推荐答案
此功能尚未在Amplify for Android中实现,但计划在不久的将来完成,如此文档.请返回文档以获取可用性更新.
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.
在此期间,您仍然可以使用Amplify.只需通过身份验证转义阴影即可访问基础AWSMobileClient.确实支持传递自定义属性.请参阅本文档,以了解有关如何精确定位的更多详细信息.使用AWSMobileClient.
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.
这篇关于如何使用Cognito通过android更新用户池属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!