search
LoginSignup
0
Help us understand the problem. What are the problem?

posted at

CognitoのユーザIDを取得(Amplify, Android)

Amplifyで認証完了後に実行

    Amplify.Auth.currentUser.userId

実装例

    // session確認
    Amplify.Auth.fetchAuthSession(
        {
            // Sessionがある場合
            var userId = Amplify.Auth.currentUser.userId
            binding.userId = userId
        },
        {
            error -> Log.e("AmplifyQuickstart", "Failed to fetch auth session", error)
        }
    )

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
0
Help us understand the problem. What are the problem?