Manage user details
Retrieve user details from your app.
Get user details
getUser() returns data about a specific user, including all custom metadata by default.
Requires App Context
Enable App Context in the Admin Portal to store user data.
Method signature
This method takes the following parameters:
1chat.getUser(
2 userId: String
3) async throws -> UserImpl?
Input
| Parameter | Description |
|---|---|
userId *Type: StringDefault: n/a | Unique user identifier (up to 92 UTF-8 characters). |
Output
| Parameter | Description |
|---|---|
UserImpl | Returned object containing the user metadata. |
Sample code
Sample code
The code samples in Swift Chat SDK focus on asynchronous code execution.
You can also write synchronous code as the parameters are shared between the async and sync methods but we don't provide usage examples of such.
Get details on user support_agent_15.
1
Get current user
currentUser returns the current chat user.
Requires App Context
Enable App Context in the Admin Portal to store user data.
Sample code
Sample code
The code samples in Swift Chat SDK focus on asynchronous code execution.
You can also write synchronous code as the parameters are shared between the async and sync methods but we don't provide usage examples of such.
Return the current chat user.
1