SendbirdSdk class

An object represents a main class to use Sendbird Chat

Constructors

SendbirdSdk({String? appId, String? apiToken, Options? options})
factory

Properties

connectionStream Stream<ConnectionEventType>
Returns a stream to listen connection events
no setter
currentUser User?
Returns current connected User, nullable.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscribedCustomTypeTotalUnreadMessageCount int
Returns total unread message count for subscribed custom types
no setter
subscribedTotalUnreadMessageCount int
Returns total unread message count for subscribed
no setter
totalUnreadMessageCountStream Stream<int>?
Returns a stream to listen message count has been changed
no setter

Methods

addChannelEventHandler(String identifier, ChannelEventHandler handler) → void
Add ChannelEventHandler with identifier to SDK.
addConnectionEventHandler(String identifier, ConnectionEventHandler handler) → void
Adds ConnectionEventHandler with identifier to SDK.
addSessionEventHandler(SessionEventHandler handler) → void
Adds SessionEventHandler to SDK.
addUserEventHandler(String identifier, UserEventHandler handler) → void
Adds UserEventHandler with identifier to SDK.
addVersionExtension(String key, String version) → void
blockUser(String userId) Future<User>
Blocks a user with userId.
channelChangedStream({String? channelUrl}) Stream<BaseChannel>
Returns a stream to listen channel change event with given channelUrl
connect(String userId, {String? nickname, String? accessToken, String? apiHost, String? wsHost}) Future<User>
Connects to Sendbird server with given parameters. If previously connected and try to connect with different userId then everything will be reset before it attempts to connect. Provide accessToken can be used if you generated the token from platform api
deliveryStream({String? channelUrl}) Stream<Map<String, int>>
Returns a stream to listen delivery event with given channelUrl
disconnect() Future<void>
Disconnects from Sendbird server
getAllEmojis() Future<EmojiContainer>
Returns EmojiContainer which contains all available Emoji
getAppInfo() AppInfo?
Returns current application information with AppInfo.
getApplicationId() String?
Returns current application id as String if initialized.
getChannelEventHandler(String identifier) ChannelEventHandler?
Returns ChannelEventHandler with given identifier.
getChannelInvitationPreference() Future<bool>
Returns true if channel invitation preference is set as auto accepted
getConnectionEventHandler(String identifier) ConnectionEventHandler?
Returns ConnectionEventHandler with identifier from SDK.
getConnectionState() ConnectionState
Returns ConnectionState.
getDoNotDisturb() Future<DoNotDisturbResponse>
Returns current do not disturb mode
getEmoji(String key) Future<Emoji>
Returns an Emoji with given key
getEmojiCategory(int categoryId) Future<EmojiCategory>
Return an EmojiCategory with given categoryId
getGroupChannelCount(MemberStateFilter filter) Future<int>
Returns number of group channel with given filter.
getInternal() SendbirdSdkInternal
getLastConnectedAt() int?
Returns current user's last connection timestamp as epoch milliseocnds, nullable
getMyGroupChannelChangeLogs({required GroupChannelChangeLogsParams params, String? token, int? timestamp}) Future<ChannelChangeLogsResponse>
Get current user's group channel change logs with params
getOptions() Options
Returns current configuration Options
getPendingToken() String?
Returns pending push token
getPushSound() Future<String>
Returns push sound in String
getPushTemplate() Future<String>
Get push template
getPushTriggerOption() Future<PushTriggerOption>
Returns PushTriggerOption of current user.
getSdkVersion() String
Returns current SDK version as String.
getSessionEventHandler() SessionEventHandler?
Returns SessionEventHandler if registered
getSnoozePeriod() Future<SnoozeResponse>
Returns current snooze period.
getTotalScheduledMessageCount({TotalScheduledMessageCountParams? params, OnTotalScheduledMessageCountCallback? callback}) Future<int>
Get Total Scheduled Message Count
getTotalUnreadChannelCount() Future<int>
Returns total number of group channels that contains unread messages.
getTotalUnreadChannelCountWithParams(GroupChannelTotalUnreadChannelCountParams params) Future<int>
Returns total number of group channels that contains unread messages with given params.
getTotalUnreadMessageCount() Future<int>
Returns total number of unrad messages.
getTotalUnreadMessageCountWithParams(GroupChannelTotalUnreadMessageCountParams params) Future<int>
Returns total number of unread messages with given params.
getUnreadItemCount(List<UnreadItemKey> keys) Future<UnreadItemCount>
Returns UnreadItemCount with given keys.
getUserEventHandler(String identifier) UserEventHandler?
Returns UserEventHandler with identifier from SDK.
isInitialized() bool
True if SDK has been initialized.
markAsDelivered({required Map<String, dynamic> data}) Future<void>
Mark a message as delivered with given payload from push notification
markAsRead({required List<String> channelUrls}) Future<void>
Mark list of group channels with channelUrls as read.
markAsReadAll() Future<void>
Mark current user's all group channels as read.
messageDeleteStream({String? channelUrl}) Stream<int?>
Returns a stream to listen messsage delete event with given channelUrl.
messageReceiveStream({String? channelUrl}) Stream<BaseMessage?>
Returns a stream to listen new messsage event with given channelUrl.
messageUpdateStream({String? channelUrl}) Stream<BaseMessage?>
Retruns a stream to listen message update event with given channelUrl.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readStream({String? channelUrl}) Stream<GroupChannel>
Returns a stream to listen read event with given channelUrl
reconnect() bool
Reconnects if previously connected and disconnect due to any reasons. It will return false if previous connection was not made.
registerPushToken({required PushTokenType type, required String token, bool alwaysPush = false, bool unique = false}) Future<PushTokenRegistrationStatus>
Registers push token with type.
removeChannelEventHandler(String identifier) → void
Removes ChannelEventHandler with identifier from SDK.
removeConnectionEventHandler(String identifier) → void
Removes ConnectionEventHandler with identifier from SDK.
removeSessionEventHandler() → void
Removes SessionEventHandler from SDK.
removeUserEventHandler(String identifier) → void
Removes UserEventHandler with identifier from SDK.
setAppVersion(String version) → void
setChannelInvitationPreference(bool autoAccept) Future<void>
Sets channel invitation preference with autoAccept. Default is true
setDoNotDisturb({required bool enable, int startHour = 0, int startMin = 0, int endHour = 23, int endMin = 59, String timezone = 'UTC'}) Future<void>
Sets do not disturb mode enable with given start and end time.
setLogLevel(LogLevel level) → void
setOptions(Options options) → void
Sets Options to configure SDK
setPushSound(String sound) Future<void>
Sets push sound.
setPushTemplate(String name) Future<void>
Sets push template with name
setPushTriggerOption(PushTriggerOption option) Future<void>
Sets push trigger option for current user.
setSnoozePeriod({required bool enable, DateTime? startDate, DateTime? endDate}) Future<void>
Sets snooze period enable with start and end date.
subscribedCustomTypeUnreadMessageCount(String customType) int?
Returns total unread messgea count for given custom type
toString() String
A string representation of this object.
inherited
unblockUser(String userId) Future<void>
Unblocks a user with userId.
unregisterAllPushToken() Future<void>
Unregisters all push token
unregisterPushToken({required PushTokenType type, required String token}) Future<void>
Unregisters push token with type.
updateCurrentUserInfo({String? nickname, FileInfo? fileInfo, List<String>? preferredLanguages, OnUploadProgressCallback? progress}) Future<void>
Updates current user information with nickname, fileInfo, preferredLanguages.
usersTypingStream({String? channelUrl}) Stream<List<User>>
Returns a stream to listen typing event with given channelUrl

Operators

operator ==(Object other) bool
The equality operator.
inherited