Skip to content

4.2.1

Latest

Choose a tag to compare

@ashfaqcometchat ashfaqcometchat released this 23 Nov 17:55
65967fb

New

  • Added offline support, off by default. Turn it on with
    OfflineConfig.Builder().setEnabled(true).build() on AppSettingsBuilder.setOfflineConfig(_:), or in
    cometchat-settings.json. With it on, the SDK keeps an on-device cache of conversations, messages,
    users, groups and media for the logged-in user and queues messages sent with no connection. Reads
    return the cached result first and the server's second, a queued message survives an app restart and
    goes out in order when the connection returns, and the SDK catches up after a reconnect. Logging out,
    or switching user, deletes that user's cache and unsent messages.
  • Added OfflineConfig for the cache's limits, media caching and optional encryption at rest (the
    bundled SQLCipher, key in the Keychain), and the state and actions isOfflineEnabled(),
    getSyncState(), getLastSyncTimestamp(), getCacheSize(), forceSyncNow(), clearOfflineCache(),
    getPendingMessages(onSuccess:onError:), retryMessage(_:), retryAllFailedMessages(),
    downloadMedia(...) and getCachedMediaPath(_:). The cache and its media are excluded from iCloud
    and device backups.
  • Added the listeners OutboxListener (the outbox), SyncListener (catch-up), MediaDownloadListener
    and OfflineCacheResetListener, and two-phase fetchNext/fetchPrevious overloads
    (onCached…/onServer…) on the message, conversation, user, group, member, banned member, blocked
    user, thread, reaction and notification feed requests.
  • Added BaseMessage.localMessageId and BaseMessage.source, Attachment.localPath, and upload
    restore: getExistingUploadFileRequest(receiverId:receiverType:parentMessageId:) and
    UploadFileRequest.getItems() let a composer show an interrupted upload again after a restart.
  • Added ERROR_MEDIA_UNAVAILABLE and ERROR_INVALID_FILE_URL to CometChatConstants.Errors.

Enhancements

  • Improved reconnecting: the SDK watches the device's network path and reconnects as soon as the network
    returns while the socket is not connected, instead of waiting for the next 15-second heartbeat. Needs
    iOS 12 or later; on iOS 11 it reconnects as before.
  • Raised the ReactionsRequest page size to 1000. A larger limit is treated as 1000; before, any limit
    above 20 failed with ERROR_LIMIT_EXCEEDED.
  • Updated the privacy manifest to declare the file timestamp, system boot time and disk space APIs the
    bundled SQLite engine and the SDK's file handling use. No action is needed.

Fixes

  • Fixed a crash when parsing a message whose attachment URL is on the secured media host after the
    sign-in was cleared, and a crash when reading groupType on a Group whose type was never set.
  • Fixed a media message whose attachment list holds something that is not an attachment being dropped;
    it is delivered with no attachments.
  • Fixed the SDK printing credentials in its debug output. The auth token, API key, websocket and calling
    JWTs and login answers now print as <redacted>, and the notification feed requests no longer print
    their URLs, headers, bodies and answers.
  • Fixed paging the pinned and saved message lists: a page continues from where the server's previous page
    ended, and a request with both pinned and saved set returns the saved list.
  • Fixed two logins, or two ReactionsRequest fetches, started from different threads both running.
  • Fixed app settings that send updateOnCustomMessage, updateOnCallActivity, updateOnGroupActions or
    updateOnReplies as a string or a number stopping every feature setting from being read, which
    reported features such as pinned messages as off.
  • Fixed a heartbeat closing a connection that had already dropped and come back, and a later drop not
    being retried.
  • Fixed UploadFileRequest.getItems() reporting 0 and nil for a file that has not produced an
    attachment yet.