SendbirdSdk class Null safety
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
read-only
- currentUser → User?
-
Returns current connected User, nullable.
read-only
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- subscribedCustomTypeTotalUnreadMessageCount → int
-
Returns total unread message count for subscribed custom types
read-only
- subscribedTotalUnreadMessageCount → int
-
Returns total unread message count for subscribed
read-only
-
totalUnreadMessageCountStream
→ Stream<
int> ? -
Returns a stream to listen message count has been changed
read-only
Methods
-
addChannelEventHandler(
String identifier, ChannelEventHandler handler) → void -
Add ChannelEventHandler with
identifierto SDK. -
addConnectionEventHandler(
String identifier, ConnectionEventHandler handler) → void -
Adds ConnectionEventHandler with
identifierto SDK. -
addSessionEventHandler(
SessionEventHandler handler) → void - Adds SessionEventHandler to SDK.
-
addUserEventHandler(
String identifier, UserEventHandler handler) → void -
Adds UserEventHandler with
identifierto 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
userIdthen everything will be reset before it attempts to connect. ProvideaccessTokencan 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
EmojiContainerwhich contains all available Emoji -
getAppInfo(
) → AppInfo? - Returns current application information with AppInfo.
-
getApplicationId(
) → String? -
Returns current application id as
Stringif initialized. -
getChannelEventHandler(
String identifier) → ChannelEventHandler? -
Returns ChannelEventHandler with given
identifier. -
getChannelInvitationPreference(
) → Future< bool> -
Returns
trueif channel invitation preference is set as auto accepted -
getConnectionEventHandler(
String identifier) → ConnectionEventHandler? -
Returns ConnectionEventHandler with
identifierfrom SDK. -
getConnectionState(
) → ConnectionState - Returns ConnectionState.
-
getDoNotDisturb(
) → Future< DoNotDisturbResponse> - Returns current do not disturb mode
-
getEmoji(
String key) → Future< Emoji> -
Returns an
Emojiwith givenkey -
getEmojiCategory(
int categoryId) → Future< EmojiCategory> -
Return an
EmojiCategorywith givencategoryId -
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
PushTriggerOptionof 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
UnreadItemCountwith givenkeys. -
getUserEventHandler(
String identifier) → UserEventHandler? -
Returns UserEventHandler with
identifierfrom 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
channelUrlsas 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 non-existent 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
falseif previous connection was not made. -
registerPushToken(
{required PushTokenType type, required String token, bool alwaysPush = false, bool unique = false}) → Future< PushTokenRegistrationStatus> -
Registers push
tokenwithtype. -
removeChannelEventHandler(
String identifier) → void -
Removes ChannelEventHandler with
identifierfrom SDK. -
removeConnectionEventHandler(
String identifier) → void -
Removes ConnectionEventHandler with
identifierfrom SDK. -
removeSessionEventHandler(
) → void - Removes SessionEventHandler from SDK.
-
removeUserEventHandler(
String identifier) → void -
Removes UserEventHandler with
identifierfrom SDK. -
setAppVersion(
String version) → void -
setChannelInvitationPreference(
bool autoAccept) → Future< void> -
Sets channel invitation preference with
autoAccept. Default istrue -
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
enablewith 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
optionfor current user. -
setSnoozePeriod(
{required bool enable, DateTime? startDate, DateTime? endDate}) → Future< void> -
Sets snooze period
enablewith 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
tokenwithtype. -
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