Constructor
new (require("sendbird"))(args)
- See:
-
Instantiates SendBird class as a singleton. sendbird.getInstance()
always returns the instance
instantiated
Parameters:
Name |
Type |
Description |
args |
Object
|
Option object for SendBird instance
Properties
Name |
Type |
Description |
appId |
string
|
Unique app id for SendBird class |
localCacheEnabled |
boolean
|
Flag for enabling/disabling local cache feature. |
|
Members
(static) LogLevel
Properties:
Name |
Type |
Description |
VERBOSE |
string
|
"verbose" |
DEBUG |
string
|
"debug" |
INFO |
string
|
"info" |
WARN |
string
|
"warn" |
ERROR |
string
|
"error" |
NONE |
string
|
"none" |
String enum object for describing type of log level
(static) version :string
Current version of SendBird SDK
Type:
appInfo
Returns application information object
(nullable) currentUser :module:model/user~User
- Default Value:
Type:
ekey
Returns key to authenticate the resource
Type:
PushTriggerOption
Properties:
Name |
Type |
Description |
ALL |
string
|
"all" |
MENTION_ONLY |
string
|
"mention_only" |
OFF |
string
|
"off" |
String enum object for describing push notifications trigger option
Type:
(inner) AppleCriticalAlertOptions :module:model/handler/appleCriticalAlertOptions~AppleCriticalAlertOptions
Type:
-
module:model/handler/appleCriticalAlertOptions~AppleCriticalAlertOptions
Type:
Type:
(inner) ConnectionHandler :module:model/handler/connectionHandler~ConnectionHandler
Type:
-
module:model/handler/connectionHandler~ConnectionHandler
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
(inner) Member :module:model/member~Member
Type:
-
module:model/member~Member
Type:
Type:
Type:
Type:
-
module:model/messageMetaArray~MessageMetaArray
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
(inner) SessionHandler :module:model/handler/sessionHandler~SessionHandler
Type:
-
module:model/handler/sessionHandler~SessionHandler
Type:
(inner) User :module:model/user~User
Type:
(inner) UserEventHandler :module:model/handler/userEventHandler~UserEventHandler
Type:
-
module:model/handler/userEventHandler~UserEventHandler
Type:
Type:
Methods
(static) getAppVersion() → {string}
Returns application version of a device info in React Native.
Returns:
-
Type
-
string
Returns:
- instantiated SendBird instance
-
Type
-
module:sendbird
(static) getLogLevel() → {string}
Returns log level of the logger
Returns:
-
Type
-
string
(static) setAppVersion(appVersion)
Sets application version of a device info in React Native.
Parameters:
Name |
Type |
Description |
appVersion |
string
|
app version of a device info in React Native. |
(static) setLogLevel(logLevel)
Sets log level of the logger
Parameters:
Name |
Type |
Description |
logLevel |
string
|
|
addChannelHandler(id, handler)
- See:
-
Adds handler to SendBird for channel-related events
Parameters:
addConnectionHandler(id, handler)
- See:
-
Adds handler to SendBird for connection-related events
Parameters:
Name |
Type |
Description |
id |
string
|
|
handler |
module:model/handler/connectionHandler~ConnectionHandler
|
|
addFriends(userIds, callbackopt) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
addUserEventHandler(id, handler)
- See:
-
Adds handler to SendBird for user-related events
Parameters:
Name |
Type |
Description |
id |
string
|
|
handler |
module:model/handler/userEventHandler~UserEventHandler
|
|
blockUser(user, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
user |
module:model/user~User
|
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
blockUserWithUserId(userId, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
connect(userId, callbackopt) → {Promise|undefined}
- See:
-
Connects to SendBird server
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
connect(userId, apiHostnullable, wsHostnullable, callbackopt) → {Promise|undefined}
- See:
-
Connects to SendBird server
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
apiHost |
string
|
<nullable>
|
Custom API Host. Internal use only. |
wsHost |
string
|
<nullable>
|
Custom WS Host. Internal use only. |
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
connect(userId, accessTokennullable, callbackopt) → {Promise|undefined}
- See:
-
Connects to SendBird server
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
accessToken |
string
|
<nullable>
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
connect(userId, accessTokennullable, apiHostnullable, wsHostnullable, callbackopt) → {Promise|undefined}
- See:
-
Connects to SendBird server
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
accessToken |
string
|
<nullable>
|
|
apiHost |
string
|
<nullable>
|
Custom API Host. Internal use only. |
wsHost |
string
|
<nullable>
|
Custom WS Host. Internal use only. |
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
Creates a query object for getting a list of all users withing the current application
Returns:
-
Type
-
module:model/query/applicationUserListQuery~ApplicationUserListQuery
Creates a query object for getting a list of blocked users by the current user
Returns:
-
Type
-
module:model/query/blockedUserListQuery~BlockedUserListQuery
Returns:
-
Type
-
module:model/query/friendListQuery~FriendListQuery
createMessageSearchQuery() → {module:model/query/messageSearchQuery~MessageSearchQuery}
Creates a query object for searching messaging by a keyword
Returns:
-
Type
-
module:model/query/messageSearchQuery~MessageSearchQuery
- Deprecated:
- since version v3.0.86, please use
createApplicationUserListQuery()
instead
Creates a query object for getting a list of users within current application with user IDs
Parameters:
Name |
Type |
Attributes |
Default |
Description |
userIds |
Array.<string>
|
<optional>
|
[]
|
|
Returns:
-
Type
-
module:compat/legacy/userListQuery~UserListQuery
deleteFriend(userId, callback) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
deleteFriendDiscoveries(discoveryKeys, callbackopt) → {Promise|undefined}
Parameters:
Name |
Type |
Attributes |
Description |
discoveryKeys |
Array.<string>
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
deleteFriendDiscovery(discoveryKey, callbackopt) → {Promise|undefined}
Parameters:
Name |
Type |
Attributes |
Description |
discoveryKey |
string
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
deleteFriends(userIds, callback) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
disableStateChange()
State change should be disabled when image picker is loaded in Android.
disconnect(callbackopt) → {Promise|undefined}
- See:
-
SendBird disconnect. Invalidates currentUser
Parameters:
Returns:
-
Type
-
Promise
|
undefined
enableStateChange()
State change should be disabled when image picker is loaded in Android.
getAllEmoji(callback) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getAllowFriendDiscovery(callback) → {Promise|undefiend}
Gets current friend discovery allow state.
Parameters:
Returns:
-
Type
-
Promise
|
undefiend
getApplicationId() → {string}
Returns App ID of the application
Returns:
-
Type
-
string
getChannelInvitationPreference(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getConnectionState() → {string}
Returns websocket server connection state
Returns:
- current connection state
ConnectionState
-
Type
-
string
getCurrentUserId() → (nullable) {string}
- Deprecated:
- since version v3.0.109, please use
currentUser
instead
Returns user id of the current user
Returns:
-
Type
-
string
getDoNotDisturb(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getEmoji(emojiKey, callback) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getEmojiCategory(categoryId, callback) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getFriendChangeLogsByToken(tokenopt, nullable, callbackopt) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getGroupChannelCount(memberStateFilteropt, callbackopt) → {Promise|undefined}
Parameters:
Name |
Type |
Attributes |
Description |
memberStateFilter |
string
|
<optional>
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
getLastConnectedAt() → {number}
Returns timestamp (UTC) in milliseconds of user's last connection, 0 if not set
Returns:
-
Type
-
number
getMyGroupChannelChangeLogsByTimestamp(ts, params, callbackopt) → {Promise|undefined}
Requests updated channels and deleted channel URLs since the timestamp and the results may contain empty channels.
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getMyGroupChannelChangeLogsByTimestamp(ts, customTypesnullable, includeEmptynullable, callbackopt) → {Promise|undefined}
- Deprecated:
Requests updated channels and deleted channel URLs since the timestamp and the results may contain empty channels.
Parameters:
Name |
Type |
Attributes |
Description |
ts |
number
|
|
|
customTypes |
Array.<string>
|
<nullable>
|
|
includeEmpty |
boolean
|
<nullable>
|
|
callback |
getGroupChannelChangeLogsHandler
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
getMyGroupChannelChangeLogsByTimestamp(ts, customTypesnullable, callbackopt) → {Promise|undefined}
- Deprecated:
Requests updated channels and deleted channel URLs since the timestamp and the results may contain empty channels.
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getMyGroupChannelChangeLogsByToken(tokennullable, params, callbackopt) → {Promise|undefined}
Requests updated channels and deleted channel URLs since a certain time. A certain time is decided by token and
the results may contain empty channels
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getMyGroupChannelChangeLogsByToken(tokennullable, customTypesnullable, includeEmptynullable, callbackopt) → {Promise|undefined}
- Deprecated:
Requests updated channels and deleted channel URLs since a certain time. A certain time is decided by token and
the results may contain empty channels
Parameters:
Name |
Type |
Attributes |
Description |
token |
string
|
<nullable>
|
|
customTypes |
Array.<string>
|
<nullable>
|
|
includeEmpty |
boolean
|
<nullable>
|
|
callback |
getGroupChannelChangeLogsHandler
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
getMyGroupChannelChangeLogsByToken(tokennullable, customTypesnullable, callbackopt) → {Promise|undefined}
- Deprecated:
Requests updated channels and deleted channel URLs since a certain time. A certain time is decided by token and
the results may contain empty channels
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getMyPushTokensByToken(token, type, callbackopt) → {Promise|undefined}
Requests device push tokens list of the current user.
Parameters:
Name |
Type |
Attributes |
Description |
token |
string
|
|
|
type |
string
|
|
one of "gcm" | "apns" | "apns_voip" |
callback |
getMyPushTokensHandler
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
getPendingAPNSToken() → {string}
Returns:
-
Type
-
string
getPendingGCMToken() → {string}
Returns:
-
Type
-
string
getPushTemplate(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getPushTriggerOption(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getSnoozePeriod(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getSubscribedCustomTypeTotalUnreadMessageCount() → {number}
Returns:
-
Type
-
number
getSubscribedCustomTypeUnreadMessageCount(customType) → {number}
Parameters:
Name |
Type |
Description |
customType |
string
|
|
Returns:
-
Type
-
number
getSubscribedTotalUnreadMessageCount() → {number}
Returns:
-
Type
-
number
getTotalUnreadChannelCount(groupChannelTotalUnreadChannelCountParams, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
groupChannelTotalUnreadChannelCountParams |
module:model/params/groupChannelTotalUnreadChannelCountParams~GroupChannelTotalUnreadChannelCountParams
|
|
|
callback |
groupChannelCountCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
getTotalUnreadChannelCount(callbackopt) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getTotalUnreadMessageCount(channelCustomTypesFilter, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getTotalUnreadMessageCount(callbackopt) → {Promise|undefined}
- Deprecated:
- since version v3.0.80, please use
getTotalUnreadMessageCount()
instead
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getTotalUnreadMessageCount(channelCustomTypesFilter, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
getUnreadItemCount(keys, callbackopt) → {Promise|undefined}
Get count of unread messages and invitations in super and non-super channels
Parameters:
Name |
Type |
Attributes |
Description |
keys |
Array.<string>
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
initializeDatabase(userId, callbackopt) → {Promise.<void>}
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise.<void>
markAsDelivered(channelUrl)
Parameters:
Name |
Type |
Description |
channelUrl |
string
|
|
markAsReadAll(callback) → {Promise|undefined}
Marks all group channels of the current user as read
Parameters:
Returns:
-
Type
-
Promise
|
undefined
markAsReadWithChannelUrls(channelUrls, callbackopt) → {Promise|undefined}
Marks specified groups as read by the current user
Parameters:
Name |
Type |
Attributes |
Description |
channelUrls |
Array.<string>
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
reconnect() → {boolean}
- See:
-
SendBird manual reconnect method, you can also enable auto-reconnect feature
Returns:
- false if user is not logged in
-
Type
-
boolean
registerAPNSPushTokenForCurrentUser(token, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
registerGCMPushTokenForCurrentUser(token, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
removeAllChannelHandlers()
- See:
-
removeAllConnectionHandlers()
- See:
-
removeAllUserEventHandler()
- See:
-
removeChannelHandler(id)
- See:
-
Parameters:
Name |
Type |
Description |
id |
string
|
|
removeConnectionHandler(id)
- See:
-
Parameters:
Name |
Type |
Description |
id |
string
|
|
removeUserEventHandler(id)
- See:
-
Parameters:
Name |
Type |
Description |
id |
string
|
|
setAllowFriendDiscovery(allowFrienDiscovery, callback) → {Promise|undefined}
Sets friend discovery allow state.
Parameters:
Name |
Type |
Description |
allowFrienDiscovery |
boolean
|
|
callback |
commonCallback
|
|
Returns:
-
Type
-
Promise
|
undefined
setBackgroundState()
Sets AppState into background (React Native/Ionic)
setChannelInvitationPreference(isAutoAccept, callback) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
setDoNotDisturb(doNotDisturbOn, startHour, startMin, endHour, endMin, timezone, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
doNotDisturbOn |
boolean
|
|
|
startHour |
number
|
|
|
startMin |
number
|
|
|
endHour |
number
|
|
|
endMin |
number
|
|
|
timezone |
string
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
setErrorFirstCallback(val)
Set to true if an error object should come first in a parameter list of callbacks. Default value is false for a
SendBird instance
Parameters:
Name |
Type |
Description |
val |
boolean
|
|
setForegroundState()
Sets AppState into foreground (React Native/Ionic)
setPushTemplate(templateName, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
setPushTriggerOption(pushTriggerOption, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
pushTriggerOption |
string
|
|
one of "all" | "mention_only" | "off" |
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
setSessionHandler(handler)
Sets handler to SendBird for session-related events
Parameters:
Name |
Type |
Description |
handler |
module:model/handler/sessionHandler~SessionHandler
|
|
setSnoozePeriod(snoozeOn, startTs, endTs, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
snoozeOn |
boolean
|
|
|
startTs |
number
|
|
|
endTs |
number
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
unblockUser(user, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
user |
module:model/user~User
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
unblockUserWithUserId(userId, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
unregisterAPNSPushTokenAllForCurrentUser(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
unregisterAPNSPushTokenForCurrentUser(token, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
token |
string
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
unregisterGCMPushTokenAllForCurrentUser(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
unregisterGCMPushTokenForCurrentUser(token, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
token |
string
|
|
|
callback |
commonCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
unregisterPushTokenAllForCurrentUser(callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Returns:
-
Type
-
Promise
|
undefined
updateCurrentUserInfo(nicknamenullable, profileUrlnullable, callbackopt) → {Promise|undefined}
- See:
-
Parameters:
Name |
Type |
Attributes |
Description |
nickname |
string
|
<nullable>
|
|
profileUrl |
string
|
<nullable>
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
updateCurrentUserInfoWithPreferredLanguages(preferredLanguages, callbackopt) → {Promise|undefined}
Parameters:
Name |
Type |
Attributes |
Description |
preferredLanguages |
Array.<string>
|
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
updateCurrentUserInfoWithProfileImage(nicknamenullable, profileImagenullable, callbackopt) → {Promise|undefined}
Parameters:
Name |
Type |
Attributes |
Description |
nickname |
string
|
<nullable>
|
|
profileImage |
File
|
<nullable>
|
|
callback |
userCallback
|
<optional>
|
|
Returns:
-
Type
-
Promise
|
undefined
uploadFriendDiscoveries(discoveries, callbackopt) → {Promise|undefined}
Parameters:
Returns:
-
Type
-
Promise
|
undefined