Getting the Current User
When a user logs in, the Kii Cloud SDK gets the user. While the user is logged in, you can get the user with an API.
When a user logs in, the SDK gets the user's access token from Kii Cloud. The SDK then stores the access token along with other user information in its static area for the details on the access token). In another word, the SDK remembers the "current user."
You can get the currently logged-in user by calling the getCurrentUser
method.
Call the refresh
method to get the latest user information from Kii Cloud.
If the getCurrentUser
method returns null, it means nobody is logged in.
The SDK can only handle one logged-in user at a time. If you want to handle multiple users, you need to login again as a different user. The login state of the previous user is lost by making this user switch.