Session class

A session represents a user's active browser tab. It also authenticates your app with TalkJS.

Annotations
  • @JS()

Constructors

Session(SessionOptions options)
Creates a TalkJS Session.

Properties

appId String
Your TalkJS AppId that can be found your TalkJS {@link https://talkjs.com/dashboard | dashboard}.
no setter
hashCode int
The hash code for this object.
no setterinherited
me User
The TalkJS {@link User} associated with the current user in your application.
no setter
readonly Unreads
Holds information about unread conversations. Lets your app be notified when the active user receives a new message.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createChatbox(ConversationBuilder? selectedConversation, ChatboxOptions? options) Chatbox
Creates a Chatbox UI
createInbox(InboxOptions? options) Inbox
Creates an Inbox UI
createPopup(ConversationBuilder? conversation, PopupOptions? options) Popup
Creates a Popup UI
destroy() → void
Disconnects all websockets, removes all UIs, and invalidates this session. You cannot use any objects that were created in this session after you destroy it.
getChatboxes() List<Chatbox>
Returns a list of all active {@link Chatbox} objects linked to this session.
getInboxes() List<Inbox>
Returns a list of all active {@link Inbox} objects linked to this session.
getOrCreateConversation(String conversationId) ConversationBuilder
A method used to either fetch or create a conversation.
getPopups() List<Popup>
Returns a list of all active {@link Popup} objects linked to this session.
hasValidCredentials() → dynamic
Verifies whether the appId is valid.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String eventType, Function handler) → void
Used to stop listening to specific TalkJS session events
on(String eventType, Function handler) → void
Used to listen to TalkJS session events
registerDevice(dynamic options) → dynamic
Registers mobile device, one user can be connected to one mobile device.
setDesktopNotificationEnabled(bool isEnabled, dynamic options) → dynamic
Sets desktop notification on or off.
syncThemeForLocalDev(String path) → void
Used to configure TalkJS to use a theme hosted on the same location as your application for development.
toString() String
A string representation of this object.
inherited
unregisterDevice() → dynamic
Unregisters mobile device, one user can be connected to one mobile device.

Operators

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