User
This section contains user Qiscus Chat SDK behavior. You can do update user profile with metadata, block user, unblock user, and get list of blocked user.
Update User Profile with Metadata
You can update user's data, for example:
qiscus.updateProfile({
name: 'updated name', // String
avatar_url: 'new-avatar-url', // String
extras: {} // Object
}).then(function (user) {
// On success
})
.catch(function (error) {
// On error
})
Where:
name
: username of its user, for display name purpose if in 1-on-1 Chat RoomavatarUrl
: Url to display user's avatar, fallback to default avatar if not providedextras
: metadata that can be as additional information to user, which consist key-value, for example key: position, and value: engineer.
Check is User Authenticated
You can check whether user is authenticated or not, and make sure that a user is allowed to use Qiscus Chat SDK features. When return true means user already authenticated, otherwise false means user not authenticated yet.
qiscus.isLogin // boolean
Block User
You can block a user with related userId
parameter, this block user only works in 1-on-1 Chat Room. When a user is in the same Group or Channel with blocked user, a user still receive messages from blocked user.
For further information you can see this section. You can also use this function by calling this method, for example:
qiscus.blockUser(userId)
.then(function (user) {
// On success
})
.catch(function (error) {
// On error
})
If you would like to enable block user feature, you can send your request to our team.
Unblock User
You can unblock a user with related userId
parameter. Unblocked user can send a message again into particular Chat Room, for example:
qiscus.unblockUser(userId)
.then(function (user) {
// On success
})
.catch(function (error) {
// On error
})
If you would like to enable block user feature, you can send your request to our team.
Get Blocked User List
You can get blocked user list with pagination, with page
parameter and you can set also the limit
number of blocked users, for example:
qiscus.getBlockedUser(page, limit)
.then(function (users) {
// On success
})
.catch(function (error) {
// On error
})
If you would like to enable block user feature, you can send your request to our team.