Public user profile is represented by User class. Object is read-only and provide access to name, avatar url, list of identities and public properties. Check entity reference for Android, iOS for more details.
The easiest way to get an instance of User is by GetSocial User Id:
1
2
3
4
5
Communities.getUser(UserId.create("getsocial-id"),{user:User->Log.d("Communities","User: $user")},{error:GetSocialError->Log.d("Communities","Failed to get user: $error")})
1
2
3
4
5
Communities.user(UserId.create(withId:"getsocial-id"),success:{userin// process user data},failure:{errorin// Ooops. There was some error while getting other user details.})
1
2
3
4
5
6
7
Communities.GetUser(UserId.Create("getsocial-id"),(user)=>{// process user data},(error)=>{// Ooops. There was some error while getting other user details.});
Communities.getUser(UserId.create('getsocial-id')).then((result)=>{}// process user data),(error)=>{});// Ooops. There was some error while getting other user details. )
Also you can get multiple users by their ids:
1
2
3
4
5
Communities.getUsers(UserIdList.create("getsocial-id","other-id"),{users:List<User>->Log.d("Communities","Users: $users")},{error:GetSocialError->Log.d("Communities","Failed to get users: $error")})
1
2
3
4
5
Communities.users(UserIdList.create(["getsocial-id","other-id"]),success:{usersin// process users data},failure:{errorin// Ooops. There was some error while getting other users details.})
1
2
3
4
5
6
7
Communities.GetUsers(UserIdList.Create("user1","user2"),(users)=>{// process users data},(error)=>{// Ooops. There was some error while getting other users details.});
Communities.getUsers(UserIdList.create(['user1','user2'])).then((result)=>{}// process user data).catchError((error)=>{});// Ooops. There was some error while getting other user details.
valquery=UsersQuery.find("John")valpagingQuery=PagingQuery(query)Communities.getUsers(pagingQuery,{result:PagingResult<User>->valusers=result.entriesLog.d("Communities","Users with name John: $users")},{error:GetSocialError->Log.d("Communities","Failed to get users: $error")})
1
2
3
4
5
6
7
8
letquery=UsersQuery.find("John Doe")query.limit=10letpagingQuery=UsersPagingQuery(query)Communities.users(pagingQuery,success:{responsein// Show list of users},failure:{errorin// Error occured})
1
2
3
4
5
6
7
8
9
varquery=UsersQuery.Find("John Doe");varpagingQuery=newPagingQuery<UsersQuery>(query);Communities.GetUsers(pagingQuery,(result)=>{// Show list of users},(error)=>{// Error occured});
constquery=UsersQuery.find('John Doe');constpagingQuery=newPagingQuery(query);Communities.findUsers(pagingQuery).then((result)=>{// Show list of users},(error)=>{console.log('Failed to find users, error: '+error.message);});