Sendbird Chat
SendbirdChat Main Class.
Types
Properties
Current application ID.
The option to detect if the android.app.Application is in background automatically.
Gets the SDK socket connection state.
The key to authenticate the url retrieved from FileMessage.plainUrl, User.plainProfileImageUrl and Thumbnail.plainUrl]. This key has to be put into the HTTP header to access the url provided by above methods.
A flag indicating whether the SDK is initialized.
Whether the app uses local caching.
The last connected timestamp.
The maximum count of files that can be included in a single com.sendbird.android.message.MultipleFilesMessage.
The option to reconnect automatically by network awareness. It is true by default.
The pending push token. null
if there is no registration pending token.
Value for setPushTemplate, HMS.setPushTemplate.
Value for setPushTemplate, HMS.setPushTemplate.
Current SDK version.
Functions
Adds a channel handler. All added handlers will be notified when events occur.
Adds a connection handler. All added handlers will be notified when events occurs.
To send additional User-Agent information please set the version information. This will be set pre-defined keys only.
Add friends.
Adds a user event handler. All added handlers will be notified when events occur.
Sets friend discoverability of current user.
Authenticates to SendbirdChat with given User
ID and auth token. This method is different from SendbirdChat.connect in that it doesn't create a websocket connection. This should be used in below cases: 1. If you want to use the interface provided by the FeedChannel only. 2. If you want to use chat interface prior to SendbirdChat.connect, i.e. SendbirdChat.getTotalUnreadMessageCount.
If you want to use the interface provided by the FeedChannel only, we'd recommend to authenticate using this function instead of SendbirdChat.connect.
Blocks the specified User
. Blocked User
cannot send messages to the blocker.
Blocks the specified User
ID. Blocked User
cannot send messages to the blocker.
Clears the db data used in local caching.
Clear cached messages of specific channel.
Connects to SendbirdChat with given User
ID and auth token. If you have created User
s without auth token, refer to connect or just pass auth token with null
.
Connects to SendbirdChat with given User
ID and auth token. If you have created User
s without auth token, refer to connect or just pass authtoken
with null
.
Creates a query instance to get the whole User
list.
Creates a query instance to get the banned user list from this channel.
Creates a query instance to get only the blocked User
(by me) list.
Creates a query instance to get friends.
Creates GroupChannelCollection instance with the params.
Creates MessageCollection instance with the params.
Creates a query instance to search for a message.
Creates a query instance to get the muted user (online and offline both) list of the channel.
Creates a query instance to get FeedChannels the current User has joined.
Creates a query instance to get the operator list from the channel.
Creates a query instance to get the whole participant list (online only) of the channel.
Creates a query to get pinned messages.
Creates a query instance to get the poll list from the channel.
Creates a query instance to get the voters of a poll option.
Creates a query instance to get the Scheduled Message
list.
Delete friend.
Delete friend discoveries.
Delete friend discovery.
Delete friends.
Disconnects from SendbirdChat.
Disconnects the websocket connection only. This does not clear the currentUser and any cached data. If you want to logout, call disconnect.
Requests the all emoji. The result is passed to handler
.
Gets friend discoverability of current user.
Gets the size of cached data. If local caching is not used, return 0 If you want to clear all cached data, call SendbirdChat.clearCachedData If you want to clear specific channel's cache, call SendbirdChat.clearCachedMessages
Gets the current User
's preference for GroupChannel
join. If this is set as true
, the User
will automatically join the GroupChannel
. If set as false
, the User
can join the GroupChannel
by calling GroupChannel.acceptInvitation or decline the invitation by calling GroupChannel.declineInvitation.
Gets Do-not-disturb option for the current User
.
Requests the emoji. The result is passed to handler
.
Requests the emoji category. The result is passed to handler
.
Get friend changelogs by token.
Retrieves Global Notification channel theme.
Gets the number of my GroupChannel
s.
Requests the changelogs of members of group channels the current user is joined in.
Requests the changelogs of members of group channels the current user is joined in.
Retrieves a single message template by given template key.
Retrieves Message template list by token
Requests the channel changelogs after given timestamp. The result is passed to handler
.
Requests the channel changelogs from given token. The result is passed to handler
.
Requests the channel changelogs after given timestamp. The result is passed to handler
.
Requests the channel changelogs from given token. The result is passed to handler
.
Requests push tokens of current user from given token. The result is passed to handler
.
Retrieves Notification template
Retrieves Notification template list by token
Gets push notification sound path for the current User
.
Gets push template option for the current User
. For details of push template option, refer to setPushTemplate. This can be used, for instance, when you need to check the push notification content preview is on or off at the moment.
Gets the current User
's push trigger option. Refer to PushTriggerOption. For details of push trigger option, refer to setPushTriggerOption.
Get the list of report categories.
Gets snooze period for the current User
.
Gets the total number of unread message of GroupChannel
s with subscribed custom types.
Gets the number of unread message of GroupChannel
with subscribed custom type.
Gets the subscribed total number of unread message of all GroupChannel
s the current user has joined.
Gets the number of total scheduled messages.
Gets the total number of unread GroupChannel
s the current user has joined.
Gets the total number of unread message of GroupChannel
s with GroupChannelTotalUnreadMessageCountParams
filter.
Gets the total number of unread notifications of FeedChannel
Gets the unread item count of GroupChannel
s corresponding to GroupChannelUnreadItemCountParams.
Gets the unread item count of GroupChannel
s from keys.
Gets the subscribed total unread message of current user.
Initializes SendbirdChat with given InitParams.
Sends mark as delivered to this channel when you received push message from us.
Sends mark as read to joined GroupChannel
s. This method has rate limit. You can send one request per second. It returns SendbirdException if you exceed the rate limit.
Sends mark as read to all joined GroupChannel
s. This method has rate limit. You can send one request per second. It returns SendbirdException if you exceed the rate limit.
Tries reconnection with previously and successfully connected user information. This can be called in ConnectionHandler.onReconnectFailed or where you check the device network status to let the SDK try reconnection. ConnectionHandler.onReconnectStarted will be called after you call this (note that it will not be called if there is previously started connection process which has not finished), and ConnectionHandler.onReconnectFailed or ConnectionHandler.onReconnectSucceeded will be called according to the connection status afterwards.
Usually, the SDK automatically retries connection process when the network connection is lost with some backoff period. When you call this method, you can start connection process immediately.
Refreshes the currently active NotificationCollection.
Registers push token for the current User
to receive push notification. To enable push notification and get a token, refer to Sendbird Docs.
Push token registration succeeds only when the connection (connect) is made. Otherwise, callback will return with PushTokenRegistrationStatus.PENDING status. Then you can register push token again by calling this method with pushToken which is provided by FCM as the token parameter, after the connection is done. This just adds token to the server. If you want to register this token and delete all the previous ones, refer to registerPushToken.
Registers push token for the current User
to receive push notification. To enable push notification and get a token, refer to Sendbird Docs.
Push token registration succeeds only when the connection (connect) is made. Otherwise, callback will return with PushTokenRegistrationStatus.PENDING status. Then, you can register push token again by calling registerPushToken after the connection is done.
Removes all channel handlers added by addChannelHandler.
Removes all connection handlers added by addConnectionHandler.
Removes all user event handlers added by addUserEventHandler.
Removes a channel handler. The deleted handler no longer be notified.
Removes a connection handler. The deleted handler no longer be notified.
Removes a user event handler. The deleted handler no longer be notified.
Sets the current User
's preference for GroupChannel
join. If this is set as true
, the User
will automatically join the GroupChannel
. If set as false
, the User
can join the GroupChannel
by calling GroupChannel.acceptInvitation or decline the invitation by calling GroupChannel.declineInvitation.
Sets Do-not-disturb option for the current User
. If this option is enabled, the current User
does not receive push notification during the specified time repeatedly. If you want to snooze specific period, use setSnoozePeriod.
Sets the push notification sound file path for the current User
. This setting will be delivered on push notification payload.
Sets push template option for the current User
. The only valid arguments for template name are PUSH_TEMPLATE_DEFAULT and PUSH_TEMPLATE_ALTERNATIVE. If PUSH_TEMPLATE_DEFAULT is set, the push notification will contain the original message in the message
field of the push notification. If PUSH_TEMPLATE_ALTERNATIVE is set, message
of push notification will be replaced by the content you've set on SendbirdChat Dashboard.
Sets the current User
's push trigger option. If certain channel's push trigger option is set to GroupChannel.PushTriggerOption.DEFAULT, it works according to the state of PushTriggerOption. If not, push messages will be triggered according to the state of GroupChannel.PushTriggerOption. Refer to GroupChannel.PushTriggerOption.
Set a SessionHandler which is required for SDK refresh the session when the current session expires.
Sets snooze period for the current User
. If this option is enabled, the current User
does not receive push notification during the given period. It's not a repetitive operation. If you want to snooze repeatedly, use setDoNotDisturb.
Unblocks the specified User
. Unblocked User
can send messages to the ex-blocker.
Unblocks the specified User
ID. Unblocked User
cannot send messages to the ex-blocker.
Unregisters push token for the current User
.
Unregisters all push token bound to the current User
.
Updates current User
's information.
Updates current User
's preferred language.
Upload friend discoveries. SendbirdChat.addUserEventHandler SendbirdChat.removeAllUserEventHandlers