Skip to content

Get User Objects

Prerequisite

Get Current User

It is not possible to obtain the instance of a current user object, but SDK provides methods to read and update user properties via static GetSocial.User class.

More information:

Get a Public User Profile

On Android public user profile is represented by PublicUser class. Object is read-only and provide access to name, avatar url, list of identities and public properties.

The easiest way to get instance of PublicUser is by GetSocial User Id:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
GetSocial.getUserById("GetSocial User Id", new Callback<PublicUser>() {
    @Override
    public void onSuccess(PublicUser publicUser) {
        // process user data
    }
    @Override
    public void onFailure(GetSocialException e) {
        // Ooops. There was some exception while getting other user details.
    }
});

There are also couple of another methods to get users:

Next Steps

Give us your feedback! Was this article helpful?

😀 🙁