For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

Offline behavior

How the Flutter Data API reconnects and resumes pending requests.

View as Markdown

Keep the same session and subscriptions when the connection drops. The SDK reconnects automatically and your existing message subscription receives the new messages when the device comes back online. Messages already loaded remain available during the interruption. Loading older history needs a connection.

Pending sends, edits and deletions

You can send, edit or delete a message while disconnected. The SDK queues the request in memory and retries it when the connection returns. Wait for the operation to succeed before showing it as delivered or applied.

Token renewal

Supply a token callback when creating the session. The SDK calls it when it needs a fresh token from your backend. If the device is offline when your callback tries to reach your backend, retry that fetch inside the callback. Once the SDK has a valid token, it resumes pending requests for the same user. Session reference

File uploads

An upload call made while offline fails. Keep the original file so your app can retry the upload once connected. Once the upload succeeds, use the returned file token to send the message. That send follows the same reconnect behavior as a text message.

After a restart

Restarting the app or reloading the page clears the SDK's in-memory history and pending requests. Reopen the conversation online to retrieve the messages and changes that reached TalkJS. If your app needs to restore drafts, retry unsent messages or reopen files while offline after a restart, save them on the device.