I have created a sample Android app using AWS mobile hub. Followed the Developer guide (https://docs.aws.amazon.com/aws-mobile/latest/developerguide/getting-started.html) and Added User Sign-in to Mobile App with Amazon Cognito.
Created a user and am successful in logging in. After logging in, I want to find the username with which i have logged in. These details will be sent to database to have a record on how many users have logged in.
Can any one suggest me how to fetch the username
getUserPool()
method'sgetCurrentUser()
and then callgetDetails()
which has the username and all other information. You can also explicitly store the username information if its not available, and then also store in database of your choice. - Rohan Dubal