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)>

Type Definitions


UpdateReason

The update reason for updated event emitted on User
Type:
  • 'friendlyName' | 'attributes' | 'online' | 'notifiable'

Events


updated

Fired when User's properties or reachability status have been updated.
Type: Object
Properties:
Name Type Description
user User Updated User
updateReasons Array.<User#UpdateReason> Array of User's updated event reasons

userSubscribed

Fired when Client is subscribed to User.
Type: User

userUnsubscribed

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