Class: User

User

Extended user information. Note that online and notifiable properties are eligible to use only if reachability function is enabled. You may check if it is enabled by reading value of Client's reachabilityEnabled property.

Properties:
Name Type Description
identity String User identity
friendlyName String User friendly name, null if not set
attributes Object Object with custom attributes for user
online Boolean User real-time channel connection status
notifiable Boolean User push notification registration status
Fires:

Methods


unsubscribe()

Removes User from subscription list.
Returns:
Promise of completion
Type
Promise.<void>

updateAttributes(attributes)

Updates user attributes.
Parameters:
Name Type Description
attributes Object Updated attributes
Returns:
Type
Promise.<(User|Error|SessionError)>

updateFriendlyName(friendlyName)

Update Users friendlyName.
Parameters:
Name Type Description
friendlyName String Updated friendlyName
Returns:
Type
Promise.<(User|Error|SessionError)>

Events


updated

Fired when User's properties or reachability status have been updated.
Type: User

userSubscribed

Fired when Client is subscribed to User.
Type: User

userUnsubscribed

Fired when Client is unsubscribed from this User.
Type: User