Session class

A session represents a currently active user.

Mixed-in types

Constructors

Session({required String appId, String? token, TokenFetcherHandler? tokenFetcher, MessageHandler? onMessage, Unreads? unreads, UnreadsChangeHandler? onUnreadsChange, ErrorHandler? onError, bool? enablePushNotifications = false, @Deprecated("Use [token] or [tokenFetcher] instead") String? signature})

Properties

appId → String
Your TalkJS AppId that can be found your TalkJS dashboard.
final
enablePushNotifications → bool?
final
hashCode → int
The hash code for this object.
no setteroverride
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
me ↔ User
getter/setter pair
onError → ErrorHandler?
final
onMessage → MessageHandler?
final
onUnreadsChange → UnreadsChangeHandler?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
signature → String?
A digital signature of the current User.id
final
token → String?
An initial JWT authentication token.
final
tokenFetcher → TokenFetcherHandler?
final
unreads → Unreads?
Deprecated. Use onUnreadsChange instead
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearPushRegistrations() → Future<void>
Unregisters all the mobile devices for the user.
destroy() → Future<void>
Invalidates this session
dispose() → void
Discards any resources used by the object.
inherited
execute(String statement) → void
For internal use only. Implementation detail that may change anytime.
getConversation({required String id, Map<String, String?>? custom, List<String>? welcomeMessages, String? photoUrl, String? subject, Set<Participant> participants = const {}}) → Conversation
getUser({required String id, required String name, List<String>? email, List<String>? phone, String? availabilityText, String? locale, String? photoUrl, String? role, Map<String, String?>? custom, String? welcomeMessage}) → User
getUserById(String id) → User
hasValidCredentials() → Future<bool>
Verifies whether the appId is valid
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setPushRegistration({Provider? provider, String? pushRegistrationId}) → Future<void>
Registers a single mobile device, as one user can be connected to multiple mobile devices.
toString() → String
A string representation of this object.
inherited
unsetPushRegistration({Provider? provider, String? pushRegistrationId}) → Future<void>
Unregisters a single mobile device, as one user can be connected to multiple mobile devices.

Operators

operator ==(Object other) → bool
The equality operator.
override