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

User info object. More...

Classes

enum  UpdateReason
 Indicates reason for user info update. More...
 

Public Member Functions

Getters
native String getFriendlyName ()
 Method that returns the friendlyName from the user info. More...
 
Attributes getAttributes ()
 Custom attributes associated with this user. More...
 
native String getIdentity ()
 Returns the identity of the user. More...
 
native boolean isOnline ()
 Return user's online status, if available. More...
 
native boolean isNotifiable ()
 Return user's push reachability. More...
 
native boolean isSubscribed ()
 Check if this user receives real-time status updates. More...
 
Setters
void setFriendlyName (String friendlyName, StatusListener listener)
 Updates the friendly name for this user info. More...
 
void setAttributes (Attributes attributes, StatusListener listener)
 Set attributes associated with this user. More...
 
Actions
native void unsubscribe ()
 Unsubscribe from this user, freeing up resources. More...
 

Detailed Description

User info object.

Member Function Documentation

Attributes com.twilio.chat.User.getAttributes ( )

Custom attributes associated with this user.

Returns
the user Attributes.
native String com.twilio.chat.User.getFriendlyName ( )

Method that returns the friendlyName from the user info.

Returns
the friendlyName.
native String com.twilio.chat.User.getIdentity ( )

Returns the identity of the user.

Returns
the identity.
native boolean com.twilio.chat.User.isNotifiable ( )

Return user's push reachability.

Returns
true if user is reachable via push, false otherwise.
native boolean com.twilio.chat.User.isOnline ( )

Return user's online status, if available.

Returns
true if user is online, false otherwise.
native boolean com.twilio.chat.User.isSubscribed ( )

Check if this user receives real-time status updates.

Returns
true if user is subscribed, false otherwise.
void com.twilio.chat.User.setAttributes ( Attributes  attributes,
StatusListener  listener 
)

Set attributes associated with this user.

Passing null will reset user attributes to an empty json object.

Parameters
attributesThe new developer-provided Attributes for this user.
listenerListener that will receive callback with the result.
void com.twilio.chat.User.setFriendlyName ( String  friendlyName,
StatusListener  listener 
)

Updates the friendly name for this user info.

Parameters
friendlyNameupdated friendly name.
listenerListener that will receive callback with the result.
native void com.twilio.chat.User.unsubscribe ( )

Unsubscribe from this user, freeing up resources.

User will no longer receive real-time status updates.