Menu

Expand
Rate this page:

Changelog: Twilio Sync iOS SDK

If you are interested in Mac Catalyst support, please contact support to get hands-on experience with it.

End-of-Life for versions 0.2.0 and below begins on April 10, 2022. Functionality will cease to work properly for these versions. Please upgrade to the latest version.

Support for 1.x will cease on April 3, 2024. Please upgrade to the latest version.

Latest release: 2.0.2

The latest release of the Sync SDK for iOS is version 2.0.2. You may download the latest version of the SDK as an Archive or integrate it as a project dependency with CocoaPods or Swift Package Manager.

CocoaPods

To install the SDK using CocoaPods, add the following to your Podfile, changing MyTarget to the name of your target:

use_frameworks!
platform :ios, '13.0'

target 'MyTarget' do
  pod 'TwilioSyncClient', '~>2.0'
end

Swift Package Manager

To install the SDK using Swift Package Manager, follow these steps:

  1. Open your project in Xcode.
  2. Select File > Swift Packages > Add Package Dependency....
  3. Enter https://github.com/twilio/twilio-sync-ios into the search field in the Choose Package Repository: dialog, then click Next.
  4. Make your versioning choice and click Next.
  5. Add the package to one of your targets and click Finish.

Version history and changelog

Links are provided to specific patch versions here. We don’t recommend using these links unless you have a specific need for a certain patch.

Sync SDK for iOS v2.0.2 (May 17, 2023)

Changes

  • Fixed a crash occurring when a delegate of a Sync object doesn't have an implementation of a correlated on{}Opened delegate method

Sync SDK for iOS v2.0.1 (May 15, 2023) deprecated

Changes

  • Fixed an issue with objects returned from on{}Opened delegate methods not properly initialized

Sync SDK for iOS v2.0.0 (April 3, 2023)

Changes

  • Reduced the SDK footprint by ~65%
  • Significantly improved stability by refactoring the transport layer

Breaking changes

  • Dropped support for iOS 12

Sync SDK for iOS v1.2.1 (September 7, 2022)

Changes

  • Fixed crash on client destroying while sync object is being opened.

Sync SDK for iOS v1.2.0 (March 14, 2022)

Changes

  • Improved performance in cases when the user subscribes to thousands of objects.

Sync SDK for iOS v1.1.1 (January 24, 2022)

Changes

  • Bug fixes.
  • Framework deployed size optimized.
  • Minimum supported iOS version: 12.

Sync SDK for iOS v1.1.0 (April 29, 2021)

Changes

  • Added support for XCFramework.
  • Added possibility to set up report queue for event and callbacks.
  • Fixed an issue with callback not returned.
  • Removed Carthage support until it supports binary XCFrameworks.
  • Fixed reconnection after restoring application from background. This issue was introduced in 1.0.0 and users are highly encouraged to upgrade to this version to avoid experiencing disconnection problems.

Sync SDK for iOS v1.0.0 (January 19, 2021)

  • Tar
  • sha256: d287322d484d2baa1562e0e589758e0a7aa63abe1e982c6c9806dbae86286f18
  • Documentation

Changes

  • Minimum supported iOS version: 11.
  • Removed deprecated methods.
  • Some methods were refactored to properties.
  • Added the previous snapshot to be able to compare to events like item was updated or removed. Changes were performed on delegate calls of TWSList, TWSMap, and TWSDocument.
  • In-page sorting was removed for pagination calls. Sorting depends on backend output.
  • Error codes and descriptions were synchronized with various iOS, Android, and JavaScript SDKs.
  • Exposed dateUpdated for all sync objects.
  • The SDK now supports HTTP proxy. Proxy is enabled with a new flag useProxy passed to client properties on client creation. Proxy settings are read from the system configuration.
  • Added the ability to defer certificate checks to the OS (disable pinning) using a new flag, deferCertificateTrustToPlatform, passed to client properties on client creation.

Sync SDK for iOS v0.8.7 (November 5, 2019)

Changes

  • Added minimum required iOS version to the start page.
  • Fixed a bug that caused an excessive subscription retry loop on failure, which would lead to an increased network and battery consumption.

Sync SDK for iOS v0.8.6 (September 24, 2019)

Changes

  • Fixed a race condition where some of the delegates could be invoked twice.
  • Fixed a crash when attempting to use an already released delegate.
  • Fixed a race condition where a callback could be invoked twice for a removed channel.

Sync SDK for iOS v0.8.5 (August 29, 2019)

Changes

  • Fixed loading of the framework from an extension.

Sync SDK for iOS v0.8.3 (June 26, 2019)

Changes

  • Improved stability on shutdown, fixed crash issue.

Sync SDK for iOS v0.8.2 (June 19, 2019)

Changes

  • Fix crash when trying to create a client with a nil token.
  • Fix numerous stability issues in the client.

Sync SDK for iOS v0.8.1 (April 17, 2019)

Changes

  • Overhauled transport and communication layer, significantly improving network traffic overhead and client performance.
  • Improved connection reliability under bad network conditions.
  • Fixed unexpected connectivity errors with code 1401: Unable to establish connection to Twilio Sync service.

Sync SDK for iOS v0.7.5 (July 3, 2018)

Changes


Sync SDK for iOS v0.7.4 (May 17, 2018)

Changes

  • Privacy by default in logging for GDPR. A new logging level has been introduced, TWSLogLevelSilent, which is also the new default level. We strongly encourage customers use this logging level for production builds especially if serving European end-users.

Sync SDK for iOS v0.7.3 (April 26, 2018)

Changes

  • Deprecated stream delegate method onStreamRemoved:eventContext:, which is now called as expected when a stream is removed. Please use the delegate method onStream:removedWithEventContext: for future compatibility.

Sync SDK for iOS v0.7.2 (March 2, 2018)

Changes

  • on*Error methods for entities will no longer be called when a failure to open occurs. The completion handler for such operations is the best way to check for success or failure on open/creation.
  • Resolved an issue where delegate method parameters marked as nonnull could receive nil objects.
  • Resolved an issue where remote update delegate calls may not be received.

Sync SDK for iOS v0.7.1 (February 7, 2018)

Changes

  • Updated internal certificate store for upcoming certificate authority changes.

Sync SDK for iOS v0.7.0 (January 17, 2018)

Changes

Synopsis of enhancements:

  • flowId has been deprecated in favor of using the completion blocks already present in the SDK.
  • The distinction between remote (for remotely initiated operations) and result (for locally initiated operations) has been transitioned to TWSEventContext's isLocal property. You will receive a call to the now shared delegate methods with this object where it is applicable. For Lists and Maps, local operations previously provided the delegate call with only the index or key for the item – the full item will now be returned for both local and remote operations.
  • Documents, Lists (and their items), Maps (and their items) and Streams may now all have an optional max time to live specified. This number is expressed in seconds and is relative to when the TTL is set. After the TTL expires, the object will be destroyed on the backend in the near future. TWSOpenOptions has been expanded to allow specifying a TTL during object creation (this property is ignored when opening preexisting objects). The TWS*Metadata classes taken as a parameter for some methods on Document, List and Map are optional and can be specified as nil.

Migration tips:

flowID has been removed globally; most places that previously accepted a flowID now accept metadata which can be nil today if you are not specifying a TTL.

Most delegate methods have changed signature. This is important to note since legacy delegate methods will generally not produce any warnings or errors with this change. The individual remote and local delegate methods have been combined into a single delegate method for operations. Delegates which previously received only an index or key will now receive the full value. Most delegate methods now also provide a TWSEventContext object which will indicate whether the operation was locally or remotely initiated.

Update squashing:

Individual local operations will continue to return the status of each operation via their completion block but updates sent to the server may be batched for efficiency. This means remote clients may not see every state update performed individually, but will instead see updates with the object's final updated state.

If you require updates to be treated as individual operations for purposes of notifying remote clients, it is recommended you schedule subsequent updates to occur after the completion of each operation.

Specific changes to classes:

  • TWSConstants
    • typedef TWSDuration (NEW)
    • constant TWSDurationInfinity (NEW)
    • block TWSDataMutator no longer takes a flowId parameter (CHANGED)
  • TWSOpenOptions
    • - (TWSOpenOptions *)ttl:(TWSDuration)ttl (NEW)
    • - (TWSDuration)ttl (NEW)
  • TWSEventContext (NEW)
    • Added to provide context to your delegate about the operation performed. Today, this includes an isLocal property which will return true if the operation was initiated by the local client, false if initiated remotely.
  • TWSDocument
    • Added -setTtl:completion: method
    • Removed flowID references, added TWSDocumentMetadata for specifying initial TTL.
Old Method New Method
-setData:flowId:completion: -setData:metadata:completion:
-mutateDataWith:flowId:completion: -mutateDataWith:metadata:completion:
-removeDocumentWithFlowId:completion: -removeDocumentWithCompletion:
-setTtl:completion: (NEW)
  • TWSDocumentDelegate
    • Updated delegate methods to remove flowID, added TWSEventContext for methods called as a result of both local and remote operations.
Old Method New Method
-onDocumentResultOpened: -onDocumentOpened:
-onDocument:resultRemovedForFlowID:
-onDocumentRemoteRemoved:
-onDocumentRemoved:eventContext:
-onDocumentResultUpdated:forFlowID:
-onDocumentRemoteUpdated:
-onDocument:updated:eventContext:
-onDocument:resultErrorOccurred:forFlowID: -onDocument:errorOccurred:
  • TWSDocumentMetadata
    • Added to optionally provide initial TTL on Document creation.
  • TWSList
    • Added -setTtl:completion: method
    • Added -setTtl:forItemAtIndex:completion: method
    • -setItemWithData:metadata:completion: now accepts a TWSListItemCompletion block instead of TWSCompletion
    • Removed flowID references, added TWSListItemMetadata for specifying TTL for items on add and modification.
Old Method New Method
-addItemWithData:flowId:completion: -addItemWithData:metadata:completion:
-getItemAtIndex:flowId:completion: -getItemAtIndex:completion:
-setItemWithData:flowId:completion: -setItemWithData:metadata:completion:
-mutateItemAtIndex:mutator:flowId:completion: -mutateItemAtIndex:mutator:metadata:completion:
-removeItemAtIndex:flowId:completion: -removeItemAtIndex:completion:
-removeListWithFlowId:completion: -removeListWithCompletion:
-setTtl:completion: (NEW)
-setTtl:forItemAtIndex:completion: (NEW)
  • TWSListDelegate
    • Updated delegate methods to remove flowID, added TWSEventContext for methods called as a result of both local and remote operations.
Old Method New Method
-onListResultOpened: -onListOpened:
-onList:resultItemAddedAtIndex:forFlowID:
-onList:remoteItemAdded:
-onList:itemAdded:eventContext:
-onList:resultItemRemovedAtIndex:forFlowID:
-onList:remoteItemRemoved:
-onList:itemRemoved:eventContext:
-onList:resultItemUpdatedAtIndex:forFlowID:
-onList:remoteItemUpdated:
-onList:itemUpdated:eventContext:
-onList:resultCollectionRemovedForFlowID:
-onListRemoteCollectionRemoved:
-onList:collecionRemovedWithEventContext:
-onList:resultErrorOccurred:forFlowID: -onList:errorOccurred:
  • TWSListItemMetadata
    • Added to optionally provide initial TTL on List Item creation or modification.
  • TWSMap
    • Added -setTtl:completion: method
    • Added -setTtl:forItemWithKey:completion: method
    • -setItemWithKey:data:metadata:completion: now accepts a TWSMapItemCompletion block instead of TWSCompletion
    • Removed flowID references, added TWSMapItemMetadata for specifying TTL for items on set and modification.
Old Method New Method
-getItemWithKey:flowId:completion: -getItemWithKey:completion:
-setItemWithKey:data:flowId:completion: -setItemWithKey:data:metadata:completion:
-mutateItemWithKey:mutator:flowId:completion: -mutateItemWithKey:mutator:metadata:completion:
-removeItemWithKey:flowId:completion: -removeItemWithKey:completion:
-removeMapWithFlowId:completion: -removeMapWithCompletion:
-setTtl:completion: (NEW)
-setTtl:forItemWithKey:completion: (NEW)
  • TWSMapDelegate
    • Updated delegate methods to remove flowID, added TWSEventContext for methods called as a result of both local and remote operations.
Old Method New Method
-onMapResultOpened: -onMapOpened:
-onMap:resultItemSetWithKey:forFlowID: (for adds)
-onMap:remoteItemAdded:
-onMap:itemAdded:eventContext:
-onMap:resultItemSetWithKey:forFlowID: (for updates)
-onMap:remoteItemUpdated:
-onMap:itemUpdated:eventContext:
-onMap:resultItemRemovedWithKey:forFlowID:
-onMap:remoteItemRemovedWithKey:
-onMap:itemRemovedWithKey:eventContext:
-onMap:resultErrorOccurred:forFlowID: -onMap:errorOccurred:
-onMap:resultCollectionRemovedForFlowID:
-onMapRemoteCollectionRemoved:
-onMap:collecionRemovedWithEventContext:
  • TWSMapItemMetadata
    • Added to optionally provide initial TTL on Map Item creation or modification.
  • TWSStream
    • Added -setTtl:completion: method
    • Removed flowID references.
Old Method New Method
-publishMessageWithData:flowId:completion: -publishMessageWithData:completion:
-removeStreamWithFlowId:completion: -removeStreamWithCompletion:
-setTtl:completion: (NEW)
  • TWSStreamDelegate
    • Updated delegate methods to remove flowID, added TWSEventContext for methods called as a result of both local and remote operations.
Old Method New Method
-onStreamResultOpened: -onStreamOpened:
-onStream:resultMessagePublished:forFlowID:
-onStream:remoteMessagePublished:
-onStream:messagePublished:eventContext:
-onStream:resultRemovedForFlowID:
-onStreamRemoteRemoved:
-onStreamRemoved:eventContext:
-onStream:resultErrorOccurred:forFlowID: -onStream:errorOccurred:

Sync SDK for iOS v0.6.2 (February 7, 2018)

Changes

  • Updated internal certificate store for upcoming certificate authority changes.

Sync SDK for iOS v0.6.1 (November 22, 2017)

Changes

  • Both Sync client creation and updateToken:completion: once again give feedback if the provided token is expired or otherwise invalid.
  • Re-connection to the Sync server will occur faster when bringing the application to the foreground or the device's network connection recovering while in the application.
  • Improved completion handler execution if network connection terminates while an operation is in progress.

Sync SDK for iOS v0.6.0 (September 14, 2017)

Changes

  • With the addition of support for iOS 11, we are deprecating support for iOS 8 in Sync iOS 0.6.x.
  • Client creation is now asynchronous, with successful client creations being delivered through the TwilioSyncClient syncClientWithToken:properties:delegate:completion:'s completion method.
  • tokenUpdate: now provides feedback via a completion method of success or failure.
  • Added Steams:
    • New openStreamWithOptions:delegate:completion: method on TwilioSyncClient.
    • New TWSStream and TWSStreamMessage objects.
    • New TWSStreamDelegate delegate.
  • Document Changes:
    • Unused onDocument:remoteErrorOccurred: delegate method removed.
    • Redundant data parameter removed from delegate calls, data property is available on document which is passed to delegate method already.
    • Document property onDocument:resultErrorOccurred: is no longer flagged as nullable, it will always be presented.
  • List Changes:
    • Unused onList:remoteErrorOccurred: delegate method removed.
    • Redundant item index parameter removed from delegate calls, index property is available on item which is passed to delegate method already.
    • Deleted list item is now passed to onList:remoteItemRemoved: instead of index.
    • List property onList:resultErrorOccurred: is no longer flagged as nullable, it will always be presented.
  • Map Changes:
    • Unused onMap:remoteErrorOccurred: delegate method removed.
    • Redundant item key parameter removed from delegate calls, key property is available on item which is passed to delegate method already.
    • Deleted map item is now passed to onMap:remoteItemRemoved: instead of key.
    • Map property onMap:resultErrorOccurred: is no longer flagged as nullable, it will always be presented.
  • OpenOptions Changes:
    • Added synchronizationStrategy: declaration, allows specifying of synchronization strategy.
  • Completion blocks now include nullability hints for return values and parameters.

Sync SDK for iOS v0.5.0 (June 21, 2017)

Changes

  • Introduced TWSTwilioClientCompletion as a parameter to client creation. Clients are no longer created as immediate returns, instead the completion block is called when the client is available and ready for use.
  • updateToken accepts a completion block now to indicate the success or failure of the token update operation.
  • Added optional TWSSynchronizationStrategy (with values TWSSynchronizationStrategyDefault and TWSSynchronizationStrategyAggressive) to TWSOpenOptions.
  • Remotely changed items within Maps no longer are notified via a single set delegate method but instead distinct added and updated delegate methods to convey which operation occurred.
  • Sync SDK log output is now prefixed with TWSY for easier evaluation of logs.
  • Deprecation of distinct uniqueName accessor on TWSOpenOptions - the set value will be available via the sidOrUniqueName accessor.

Sync SDK for iOS v0.2.0 (March 16, 2017)

Changes

  • Resolved potential incompatibility with other Twilio SDKs in the same project.
  • Updated framework signing for AppStore compatibility.
  • The endpoint_id identifier specified in access tokens is now automatically generated and persisted in the keychain. The following should be observed with this change:
    • endpoint_id is no longer a required identifier in your generated access tokens, you may omit it from this build forward.
    • endpoint_id will be ignored if specified with your access token.
    • When running in the iOS simulator only, the automatically generated endpoint_id may not persist between runs to the simulator keychain without this [work-around].
  • If a client is initially created with an invalid access token, creation will fail and nil will be returned for the client instance.
  • Added new error callback to SyncClient: - (void)syncClient:(nonnull TwilioSyncClient *)client errorReceived:(nonnull TWSError *)error; will be called in case of client failures, for example when using an invalid access token.
  • Security enhancements
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

Loading Code Sample...
        
        
        

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        thanks-feedback-gif