Hierarchy

  • default

Properties

Accessors

Methods

Properties

message: MessageModule

Represents operation options.

Accessors

  • get instance(): default
  • Returns default

    Description

    An active SendbirdChat instance.

  • get version(): string
  • Returns string

    Description

    Current SDK version.

  • get apnsPushToken(): null | string
  • Returns null | string

    Description

    Current APNS push token given to registerAPNSPushTokenForCurrentUser().

  • get appId(): string
  • Returns string

    Description

    Current application ID.

  • get appInfo(): null | AppInfo
  • Returns null | AppInfo

    Description

    Represents information obtained from the application settings.

  • get appVersion(): string
  • Returns string

    Description

    The customer app version to log by the app version.

  • get currentUser(): null | User
  • Returns null | User

    Description

    The current connected User. null if connect is not called.

  • get debugMode(): boolean
  • Returns boolean

    Description

    Debug mode: showing console logs, using memory database, etc.

  • get ekey(): string
  • Returns string

    Description

    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.

  • get fcmPushToken(): null | string
  • Returns null | string

    Description

    Current FCM push token given to registerFCMPushTokenForCurrentUser().

  • get isCacheEnabled(): boolean
  • Returns boolean

    Description

    Whether the app uses local caching.

  • get lastConnectedAt(): number
  • Returns number

    Description

    The last connected timestamp.

  • get logLevel(): LogLevel
  • Returns LogLevel

    Description

    LogLevel for Sendbird.

  • set logLevel(val): void
  • Parameters

    Returns void

Methods

  • Type Parameters

    • Modules extends default[]

    Parameters

    Returns SendbirdChatWith<Modules>

    SendbirdChatWith

    Description

    Initializes SendbirdChat with given SendbirdChatParams.

  • Parameters

    Returns void

    Description

    Adds a connection handler. All added handlers will be notified when events occurs.

  • Parameters

    • key: string
    • version: string

    Returns void

    Description

    To send additional User-Agent information please set the version information. This will be set pre-defined keys only.

  • Parameters

    • userIds: string[]

    Returns Promise<User[]>

    Description

    Add friends.

  • Parameters

    Returns boolean

    Description

    Internal purpose. DO NOT USE it for customers.

  • Parameters

    Returns void

    Description

    Adds a user event handler. All added handlers will be notified when events occur.

  • Parameters

    • userId: string
    • Optional authToken: string

    Returns Promise<User>

    Description

    If you want to use the interface provided by the FeedChannel only, we'd recommend to authenticate using this function instead of SendbirdChat.connect.

  • Parameters

    • userOrUserId: string | User

    Returns Promise<void>

    Description

    Blocks the specified User. Blocked User cannot send messages to the blocker.

  • Parameters

    • userId: string

    Returns Promise<void>

    Description

    Blocks the specified User with userId. Blocked User cannot send messages to the blocker.

  • Parameters

    • serialized: object

    Returns User

    Description

    Makes a User from User-serialized object.

  • Returns Promise<void>

    Description

    Clears the database used for local caching.

  • Parameters

    • channelUrls: string[]

    Returns Promise<void>

    Description

    Clears cached messages of specific channel.

  • Parameters

    • userId: string
    • Optional authToken: string

    Returns Promise<User>

    Description

    Connects to SendbirdChat with given User ID and auth token. If you have created Users without auth token, you could ignore authToken.

  • Parameters

    • userId: string

    Returns Promise<void>

    Description

    Deletes a friend.

  • Parameters

    • discoveryKeys: string[]

    Returns Promise<void>

    Description

    Deletes friend discoveries.

  • Parameters

    • discoveryKey: string

    Returns Promise<void>

    Description

    Deletes friend discovery.

  • Parameters

    • userIds: string[]

    Returns Promise<void>

    Description

    Deletes friends.

  • Returns Promise<void>

    Description

    Disconnects from SendbirdChat.

  • Returns Promise<void>

    Description

    Disconnects the WebSocket connection only. It does not clear the currentUser and cached data. If you want to logout, call disconnect.

  • Returns Promise<boolean>

    Description

    Gets friend discoverability of current user.

  • Returns Promise<number>

    Description

    Gets the size of cached data. Returns 0 if local cache is disabled.

  • Returns Promise<InvitationPreference>

    Description

    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().

  • Parameters

    • emojiKey: string

    Returns Promise<Emoji>

    Description

    Requests the emoji.

  • Parameters

    • categoryId: number

    Returns Promise<EmojiCategory>

    Description

    Requests the emoji category.

  • Parameters

    • token: string

      A pagination token

    Returns Promise<FriendChangelogs>

    Description

    Gets friend changelogs by token.

  • Returns null | default

    MemoryStore

    Description

    (Debug mode only) Get the raw data store.

  • Parameters

    Returns Promise<PushTokens>

    Description

    Gets all the push tokens registered to this User.

  • Returns Promise<PushTemplate>

    Description

    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.

  • Returns Promise<PushTriggerOption>

    Description

    Gets the current User's push trigger option. Refer to PushTriggerOption. For details of push trigger option, refer to setPushTriggerOption.

  • Returns Promise<SnoozePeriod>

    Description

    Gets snooze period for the current User.

  • Parameters

    • userId: string

    Returns Promise<void>

    Description

    Initializes local cache database.

  • Mark push notification as clicked for push delivery tracking purpose only.

    Parameters

    • pushData: Record<string, unknown>

      The payload data from the push notification.

    Returns Promise<void>

  • Mark push notification as delivered for push delivery tracking purpose only.
    This does not mark the message as delivered.
    Marking the message as delivered can be done by [GroupChannelModule.markAsDelivered].

    Parameters

    • pushData: Record<string, unknown>

      The payload data from the push notification.

    • allowedPushNotification: boolean = true

      Only for Android, the POST_NOTIFICATIONS permission.

    Returns Promise<void>

  • Returns boolean

    Description

    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.

  • Parameters

    • token: string
    • Optional details: PushTokenRegistrationDetails

    Returns Promise<PushTokenRegistrationState>

    Description

    Registers an APNS push token to the server.

  • Parameters

    • token: string
    • Optional details: PushTokenRegistrationDetails

    Returns Promise<PushTokenRegistrationState>

    Description

    Registers an FCM push token to the server.

  • Returns void

    Description

    Removes all connection handlers added by addConnectionHandler.

  • Returns void

    Description

    Removes all user event handlers added by addUserEventHandler.

  • Parameters

    • key: string

    Returns void

    Description

    Removes a connection handler for the key. The deleted handler no longer be notified.

  • Parameters

    • key: string

    Returns void

    Description

    Removes a user event handler for the key. The deleted handler no longer be notified.

  • Parameters

    • allowFriendDiscovery: boolean

    Returns Promise<boolean>

    Description

    Sets friend discoverability of current user.

  • Returns void

    Description

    Sets the SDK as background mode. It closes WebSocket connection but keeps the currentUser and cached data.

  • Parameters

    • willAutoAccept: boolean

    Returns Promise<InvitationPreference>

    Description

    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().

  • Parameters

    • doNotDisturbOn: boolean
    • startHour: number = 0
    • startMin: number = 0
    • endHour: number = 0
    • endMin: number = 0
    • timezone: string = ''

    Returns Promise<DoNotDisturbPreference>

    Description

    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.

  • Returns void

    Description

    Recovers the SDK from the background mode. It re-establishes WebSocket connection for the currentUser.

  • Parameters

    Returns void

    Description

    Sets custom offline status detection handler.

  • Parameters

    Returns void

    Description

    Sets custom online status detection handler.

  • Parameters

    Returns Promise<PushTemplate>

    Description

    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.

  • Parameters

    Returns Promise<PushTriggerOption>

    Description

    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.

  • Parameters

    Returns void

    Description

    Set a SessionHandler which is required for SDK refresh the session when the current session expires.

  • Parameters

    • snoozeOn: boolean
    • startTs: number = 0
    • endTs: number = 0

    Returns Promise<SnoozePeriod>

    Description

    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.

  • Parameters

    • userOrUserId: string | User

    Returns Promise<void>

    Description

    Unblocks the specified User. Unblocked User can send messages to the ex-blocker.

  • Parameters

    • userId: string

    Returns Promise<void>

    Description

    Unblocks the specified User with userId. Unblocked User can send messages to the ex-blocker.

  • Returns Promise<void>

    Description

    Deregister all APNS push tokens for the user.

  • Returns Promise<void>

    Description

    Deregister all FCM push tokens for the user.

  • Parameters

    Returns Promise<User>

    Description

    Updates current User's information.

  • Parameters

    • preferredLanguages: string[]

    Returns Promise<User>

    Description

    Updates current User's preferred language.

  • Parameters

    Returns Promise<string>

    A friend discovery request ID.

    Description

    Uploads friend discoveries.

Generated using TypeDoc