User object
User represents a single user in a chat.
Properties
The UserImpl class implements the User protocol and takes following properties:
1extension UserImpl: User {
2 public var chat: ChatImpl
3 public var id: String
4 public var name: String?
5 public var externalId: String?
6 public var profileUrl: String?
7 public var email: String?
8 public var custom: [String: JSONCodableScalar]?
9 public var status: String?
10 public var type: String?
11 public var updated: String?
12 public var lastActiveTimestamp: TimeInterval?
13}
| Parameter | Description |
|---|---|
chatType: ChatImpl | Reference to the main Chat protocol. |
idType: String | Unique ID of the user. |
nameType: String | Display name or username of the user (must not be empty or consist only of whitespace characters). |
externalIdType: String | Identifier for the user from an external system, such as a third-party authentication provider or a user directory. |
profileUrlType: String | URL to the user's profile or avatar image. |
emailType: String | User's email address. |
customType: [String: JSONCodableScalar] | Any custom properties or metadata associated with the user in the form of a JSON. App Context filtering language doesn’t support filtering by custom properties. |
statusType: String | Current status of the user, like online, offline, or away. |
typeType: String | Type of the user, like admin, member, guest. |
updatedType: String | Timestamp (a number of seconds since January 1, 1970) for the last time the user information was updated or modified. |
lastActiveTimestampType: TimeInterval | Timestamp for the last time the user was active in a chat app. |
API limits
To learn about the maximum length of parameters used to set user metadata, refer to REST API docs.
Methods
You can call the following methods on the User object.
Click on each method for more details.
Use case
User methods enable:
- Creating and managing users
- Configuring channel memberships
- Mentioning others in conversations
- Checking user presence status