Chat Android SDK  7.0.1
com.twilio.chat.Users Class Reference

Provides access to users and allows to manipulate user information. More...

Public Member Functions

Getters
void getChannelUserDescriptors (String channelSid, CallbackListener< Paginator< UserDescriptor >> listener)
 Get paginated user descriptors from a given channel. More...
 
void getUserDescriptor (String identity, CallbackListener< UserDescriptor > listener)
 Get user descriptor based on user identity. More...
 
void getAndSubscribeUser (String identity, CallbackListener< User > listener)
 Get user based on user identity and subscribe to real-time updates for this user. More...
 
native List< UsergetSubscribedUsers ()
 Get a list of currently subscribed User objects. More...
 
native User getMyUser ()
 Get logged in User object. More...
 

Detailed Description

Provides access to users and allows to manipulate user information.

Member Function Documentation

void com.twilio.chat.Users.getAndSubscribeUser ( String  identity,
CallbackListener< User listener 
)

Get user based on user identity and subscribe to real-time updates for this user.

There's a limit on the number of simultaneously subscribed objects in the SDK. This is to reduce consumed memory and network traffic.

Parameters
identityUser identity to query.
listenerListener to receive resulting subscribed User object.
See also
getSubscribedUsers()
void com.twilio.chat.Users.getChannelUserDescriptors ( String  channelSid,
CallbackListener< Paginator< UserDescriptor >>  listener 
)

Get paginated user descriptors from a given channel.

This is a convenience function allowing to query user list in a channel. The returned paginator can be used to iterate full user list in the channel roster.

Parameters
channelSidSID of channel to query.
listenerListener to receive the resulting Paginator.
native User com.twilio.chat.Users.getMyUser ( )

Get logged in User object.

Returns the User object for your currently logged in User. You can query and update this object at will.

Returns
Own User object.
native List<User> com.twilio.chat.Users.getSubscribedUsers ( )

Get a list of currently subscribed User objects.

These objects receive status updates in real-time. When you subcribe to too many users simultaneously, the oldest subscribed users will be automatically unsubscribed.

Returns
List of subscribed User objects.
void com.twilio.chat.Users.getUserDescriptor ( String  identity,
CallbackListener< UserDescriptor listener 
)

Get user descriptor based on user identity.

Parameters
identityUser identity to query.
listenerListener to receive resulting UserDescriptor.