首页 文章

AWS Mobile Hub - 如何获取用户名

提问于
浏览
0

我使用AWS移动中心创建了一个示例Android应用程序 . 遵循开发人员指南(https://docs.aws.amazon.com/aws-mobile/latest/developerguide/getting-started.html)并使用Amazon Cognito添加用户登录移动应用程序 .

创建了一个用户并成功登录 . 登录后,我想找到我已登录的用户名 . 这些详细信息将被发送到数据库,以记录有多少用户登录 .

任何人都可以建议我如何获取用户名

1 回答

  • 0

    问题已解决 . 我使用下面的代码来获取用户名:
    CognitoUserPool userpool = new CognitoUserPool(AuthenticatorActivity.this, new AWSConfiguration(AuthenticatorActivity.this)); String str = userpool.getCurrentUser().getUserId();

相关问题