Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here.
If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.
We recommend using these links in your projects. As we patch bugs, these links will automatically be updated with the fixes.
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 of a release.
ipMessgingClient:onError:
is no longer called for transient network errors that result in a retryTWMClientConnectionState
are:1TWMClientConnectionStateUnknown, ///< Client connection state is not yet known.2TWMClientConnectionStateDisconnected, ///< Client is offline and no connection attempt in process.3TWMClientConnectionStateConnected, ///< Client is online and ready.4TWMClientConnectionStateConnecting, ///< Client is offline and connection attempt is in process.5TWMClientConnectionStateDenied, ///< Client connection is denied because of invalid token.6TWMClientConnectionStateError ///< Client connection is in the erroneous state.
ipMessagingClient:connectionStateChanged:
shutdown
first. It was possible to receive crashes in third party crash reporters if the host application was terminated by the OS in the background or manually by the user leading to an unclean termination of the IP Messaging client. The SDK now listens for termination notification and attempts to shut down the IP Messaging client gracefully and will be more forgiving in the event this cleanup does not complete in time.This release may be used with IP Messaging 0.15.1 posted below. It is also available in CocoaPods.
This release may be used with IP Messaging 0.15.1 posted below. It is also available in CocoaPods.
Note: This release of IP Messaging should be used in conjunction with the iOS Twilio Common 0.3.1 version
identity
property has been moved to userInfo.identity
ipMessagingClientWithAccessManager:delegate:
method. If you wish to maintain this flow, you can create a TwilioIPMessagingClientProperties
object with the following settings. Please note that the rest of the new initialization flow will also apply, please see the migration guide for details
synchronizationStrategy = TWMClientSynchronizationStrategyAll
initialMessageCount = UINT_MAX // (UInt32.max in Swift)
channelsListWithCompletion:
has been removed, please use the synchronous channelsList
instead after receiving notification of client synchronization. Prior to that event, this method will return nil
ipMessagingClient:channelHistoryLoaded:
has been removed, please see the new ipMessagingClient:channel:synchronizationStatusChanged:
for notification of the initial message load completion or the various get messages methods on TWMMessages
for message loads after initial channel synchronizationipMessagingClient:channelHistoryLoaded:
has been removed, please see the new ipMessagingClient:channel:synchronizationStatusChanged:
for notification of the initial message load completion or the various get messages methods on TWMMessages
for message loads after initial channel synchronizationloadChannelsWithCompletion:
method has been removed, this operation is now performed internally during client synchronization when necessaryidentity
property has been moved to userInfo.identity
TWMMessages
now has a setNoMessagesConsumed
method. This will reset the user's consumption horizon on the channel to no messages having been seen*AsDate
variants for native NSDate*
objects)With this release of IP Messaging, we have introduced a new client and channel initialization flow. For 0.14.1, both the legacy initialization flow and the new flow are supported. In a near future release, we will be removing the now deprecated legacy initialization flow.
channelsListWithCompletion:
was called then loadChannelsWithCompletion:
upon the resultant channels list-ipMessagingClient:channelHistoryLoaded:
delegate callback indicated when each channel was fully readyYour existing code will continue to function using the original client initialization semantics but to take advantage of the new functionality, the follow changes must be made all together:
channelsListWithCompletion:
returns an error and will be deprecated in an upcoming release, please use the synchronous channelsList
instead. Note this will be nil until the client is synchronized to at least the TWMClientSynchronizationStatusChannelsListCompleted
status.ipMessagingClient:channelHistoryLoaded:
method will no longer be called after messages are loaded. If your synchronization policy has full channel history loading (messagesToLoad == UINT_MAX) then history is available upon the channel reaching TWMChannelSynchronizationStatusAll status or the synchronizeWithCompletion:
block is executed upon a successful synchronize.members
and messages
will no longer block if the channel has not completed synchronization (TWMChannelSynchronizationStatusAll), they will immediately return nilsynchronizeWithCompletion:
for any channels you wish to interact with if your client synchronization strategy was specified as TWMClientSynchronizationStrategyChannelsList
ipMessagingClient:synchronizationStatusChanged:
delegate method for updates to the synchronization status. TWMClientSynchronizationStatusChannelsListCompleted
indicates the channel objects are available and the TWMClientSynchronizationStatusCompleted
callback indicates the channel's data, including the specified number of initial messages, are ready.ipMessagingClientWithAccessManager:properties:delegate:
methodipMessagingClient:synchronizationStatusChanged:
. If 'status' is TWMClientSynchronizationStatusChannelsListCompleted, display the channels to the user you obtain from [client.channelsList allObjects]expired
status after the application returned to the foreground+setLogLevel:
on the TwilioIPMessagingClient object at any time, including pre-initialization. See the header file or documentation for supported logging levels. During beta, the default logging level will remain TWMLogLevelDebug
.Breaking Changes: Twilio IP Messaging 0.14 brings a number of very useful changes which will require some changes in your pre-existing code.
The biggest change in 0.14 is the introduction of more descriptive responses in the event of an error during an operation. Previously, all callback blocks for IP Messaging operations returned a enumeration TWMResult
which had a Success or Failure value.
TWMResult
is now a full object with a new property and Boolean method available:
- (BOOL)isSuccessful
will return YES if the operation was successful or NO in the event of failure.
- (TWMError *)error
will hold an NSError derived object describing the nature of the failure, if the operation is not successful.
To adopt the new error reporting scheme, you should:
TWMResult
to be an object referenced, TWMResult *
instead of an enumeration scalar.TWMResult
against TWMResultSuccess
to instead verify the - (BOOL)isSuccessful
method returns YESTWMResult
against TWMResultFailure
to compare - (BOOL)isSuccessful
against NO and optionally interrogate the error
property for additional details.-createChannelWithFriendlyName:type:completion:
method has been retired. Please see the -createChannelWithOptions:completion:
method for its replacement.+ipMessagingClientWithToken:delegate:
method has been retired. Please see the +ipMessagingClientWithAccessManager:delegate:
method for its replacement.userInfo
properties for the logged in user and each channel member's UserInfo respectively.ipMessagingClient:userInfo:changed:
, which will be called when the UserInfo changes for the logged in user or any user that is a member of a subscribed channel.ipMessagingClient:channel:member:userInfo:changed:
, which will be called when the user info changes for a given member.memberWithIdentity:
method to obtain a reference to the TWMMember by identity.identity
property on TWMMember and TwilioIPMessagingClass are now deprecated and will be removed in a future release. The preferred way to obtain the identity for these objects is with the new userInfo class, for example: member.userInfo.identity
.With this release, the mechanism for installing the IP Messaging framework with Cocoapods has changed. Instead of including two static links in your Podfile, you will instead specify a custom source
at the top of your Podfile and a single pod line:
1source 'https://github.com/twilio/cocoapod-specs'23pod 'TwilioIPMessagingClient'4
After making this change to your Podfile, run pod install
. For future IP Messaging updates, you can run pod update
to update IP Messaging and Common.
CRITICAL
messages in the log related to not enough free threads; this error can be safely disregarded.TwilioIPMessagingClient
may take up to 30 seconds for a particularly busy instance. You should call this on a background thread to avoid blocking your main UI thread. Be sure to keep a strong reference to the client until this synchronous method returns.TwilioAccessManager
may deadlock when updating the Access Token from the same thread that is handling the tokenExpired
delegate callback. Use a separate thread in order to ensure the updateToken
operation does not block the tokenExpired
callback.TwilioAccessManager
will alert the client 3 minutes prior to expiry to ensure sufficient time to obtain and set a new token before expiry.tokenExpired
event is called not at expiry but 3 minutes prior to ensure sufficient time to update to new token.TwilioIPMessagingClient
initialization method ipMessagingClientWithToken:
will be retired in favor of ipMessagingClientWithAccessManager:
.createChannelWithFriendlyName:type:completion:
method on TWMChannels
will be retired in favor of createChannelWithOptions:
, which takes an NSDictionary
of options.updateToken
method will now recover gracefully if a user's token has been allowed to completely expire.TwilioIPMessagingClient
may take up to 30 seconds for a particularly busy instance. You should call this on a background thread to avoid blocking your main UI thread. Be sure to keep a strong reference to the client until this synchronous method returns.TwilioAccessManager
may deadlock when updating the Access Token from the same thread that is handling the tokenExpired
delegate callback. Use a separate thread in order to ensure the updateToken
operation does not block the tokenExpired
callback.TwilioAccessManager
will alert the client 3 minutes prior to expiry to ensure sufficient time to obtain and set a new token before expiry.tokenExpired
event is called not at expiry but 3 minutes prior to ensure sufficient time to update to new token.TwilioIPMessagingClient
initialization method ipMessagingClientWithToken:
will be retired in favor of ipMessagingClientWithAccessManager:
.createChannelWithFriendlyName:type:completion:
method on TWMChannels
will be retired in favor of createChannelWithOptions:
, which takes an NSDictionary
of options.updateToken:completion:
method on TwilioIPMessagingClient
has been removed in favor of relaying token updates through TwilioAccessManager
Classes:
1TMChannel -> TWMChannel2TMChannels -> TWMChannels3TMMember -> TWMMember4TMMembers -> TWMMembers5TMMessage -> TWMMessage6TMMessages -> TWMMessages7TMError -> TWMError
Delegates:
TMChannelDelegate -> TWMChannelDelegate
Enumerations:
1TMChannelTypeEnum -> TWMChannelType2TMChannelTypePublic -> TWMChannelTypePublic3TMChannelTypePrivate -> TWMChannelTypePrivate45TMResultEnum -> TWMResult6TMResultSuccess -> TWMResultSuccess7TMResultFailure -> TWMResultFailure89TMChannelStatusEnum -> TWMChannelStatus10TMChannelStatusNotParticipating -> TWMChannelStatusNotParticipating11TMChannelStatusJoined -> TWMChannelStatusJoined12TMChannelStatusInvited -> TWMChannelStatusInvited
Blocks:
1TSCompletion -> TWMCompletion2TMChannelListCompletion -> TWMChannelListCompletion3TMChannelCompletion -> TWMChannelCompletion
TwilioAccessManager
is a new class for managing the Access Token lifecycle. This class provides token lifecycle events and mechanism to update the token used by clients through its delegate and exposes a standard interface for managing tokens across both Twilio IP Messaging and Twilio Video SDKs. You can see an example of how to use this new class in the IP Messaging Quickstart Guide.TwilioAccessManager
may deadlock when updating the Access Token from the same thread that is handling the tokenExpired
delegate callback. Use a separate thread in order to ensure the updateToken
operation does not block the tokenExpired
callback.TwilioAccessManager
will alert the client 3 minutes prior to expiry to ensure sufficient time to obtain and set a new token before expiry.tokenExpired
event is called not at expiry but 3 minutes prior to ensure sufficient time to update to new tokenTwilioIPMessagingClient
initialization method ipMessagingClientWithToken:
will be retired in favor of ipMessagingClientWithAccessManager:
.createChannelWithFriendlyName:type:completion:
method on TWMChannels
will be retired in favor of createChannelWithOptions:
, which takes an NSDictionary
of options.