Chat Android SDK  4.0.4
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...
 
JSONObject getAttributes ()
 Custom attributes associated with the user info. 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 (JSONObject updatedAttributes, StatusListener listener)
 Updates the attribute data for this user info. More...
 
Actions
native void unsubscribe ()
 Unsubscribe from this user, freeing up resources. More...
 

Detailed Description

User info object.

Member Function Documentation

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

Custom attributes associated with the user info.

Returns
the map of attributes as a JSONObject.
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 ( JSONObject  updatedAttributes,
StatusListener  listener 
)

Updates the attribute data for this user info.

Parameters
updatedAttributesattributes to change.
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.