Changelog: Twilio Chat Android SDK

Latest releases for the Programmable Chat Android SDK

We recommend using these links in your projects. As we patch bugs, these links will automatically be updated with the fixes.

Programmable Chat Android v2.0

Programmable Chat Android v1.0

Migrating from Beta to GA

Programmable Chat is now in GA. A number of breaking changes were introduced as part of the GA release. To see what has changed and to migrate from the latest Beta SDK to the new GA SDK, please read the GA Migration Guide for Android.

Migrating from IP Messaging to Programmable Chat

Programmable Chat is the new name of what was previously called IP Messaging. If you are an existing IP Messaging user, you will want to follow the Migration Guide for Android.

If you are looking for the archived IP Messaging Android changelog, it can be found here.

Change Logs

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.


Programmable Chat Android 2.0.2 (November 9, 2017)

Bug Fixes

  • Fixed an issue where a disposed ChatClient would attempt to reconnect to Twilio on application foregrounding.
  • BEHAVIORAL CHANGE: Bug-fix so joining an already joined channel or attempting to add an already joined member to a channel will now correctly return a failure result.
  • Fixed an issue where the ChatClient could sometimes crash during initialization.
  • Unconsumed messages count on joined channels should immediately reflect changes made by new consumption horizon update methods described below.
  • Improved documentation.

Changes

  • Added logging to reflect ChatClient detecting the application transitioning into the background or foreground.
  • Improvements to memory utilization.
  • Unimplemented Channel.setType() removed from the SDK.
  • Added updated consumption horizon methods which return an updated number of unconsumed messages in the listener callback:
    • setLastConsumedMessageIndexWithResult()
    • advanceLastConsumedMessageIndexWithResult()
    • setAllMessagesConsumedWithResult()
    • setNoMessagesConsumedWithResult()

Deprecations

  • Deprecated old consumption horizon update methods which did not take a completion listener. Please use the newly added methods which do accept a completion listener above.
    • setLastConsumedMessageIndex()
    • advanceLastConsumedMessageIndex()
    • setAllMessagesConsumed()
    • setNoMessagesConsumed()

Programmable Chat Android 2.0.1 (October 11, 2017)

Bug Fixes

  • SDK will no longer crash on client construction on devices prior to API 21.
  • Re-connection to the Chat service will occur faster when bringing the application to the foreground.
  • Both chat client creation and updateToken() once again give feedback if the provided token is expired or otherwise invalid.
  • Fixed an issue where the listener for joinChannel sometimes was not called.
  • Fixed an issue where properties of Message were sometimes not fully populated by the time sendMessage's listener was called.

Programmable Chat Android 2.0.0 (September 18, 2017)

New Features

Changes

  • BREAKING: Added UpdateReasons to onMessageUpdated and onMemberUpdated callbacks.
  • BREAKING: Removed the deprecated enum SynchronizationStrategy.
  • BREAKING: Use Message.Options to construct and sendMessage()
    • You now could fully initialise necessary message attributes before sending it out.
  • BREAKING: Members.add(), .addByIdentity(), .invite(), .inviteByIdentity(), .removeByIdentity() updated to new chat-lib API
  • Return empty JSON object instead of empty string if Message attributes are empty.

Bug Fixes

  • Fixed a crash on API 19 devices that prevented SDK use.

Legacy versions

Programmable Chat Android 1.0.11 (October 11, 2017)

Bug Fixes

  • Fixed an infrequently occurring crash on chat client shutdown.
  • SDK will no longer crash on client construction on devices prior to API 21.
  • Re-connection to the Chat service will occur faster when bringing the application to the foreground.
  • Both chat client creation and updateToken() once again give feedback if the provided token is expired or otherwise invalid.
  • Fixed an issue where the listener for joinChannel sometimes was not called.
  • Fixed an issue where properties of Message were sometimes not fully populated by the time sendMessage's listener was called.

Programmable Chat Android 1.0.10 (August 22, 2017)

Changes

  • Performance enhancements for client startup and data retrieval.

Programmable Chat Android 1.0.9 (July 25, 2017)

Bug Fixes

  • channel.join() listener will be called after joined channel has been completely synchronized.

Programmable Chat Android 1.0.8 (July 5, 2017)

Bug Fixes

  • Fixed issues related to thread management, which in many cases should lead to significant performance gains
  • Fixed crashes on Client shutdown.

Programmable Chat Android 1.0.7 (June 29, 2017)

Bug Fixes

  • Fixed an issue whereby setAllMessagesConsumed() in an empty channel could cause the SDK client to crash.

Programmable Chat Android 1.0.6 (June 21, 2017)

Bug Fixes

  • Fixed an issue whereby GCM/FCM unregistration callbacks were not reliably being called.

Programmable Chat Android 1.0.5 (June 20, 2017)

Bug Fixes

  • Fixed additional issues with some commands not correctly completing - i.e. no success callback nor failure was received. This release fixes cases not addressed by the previous release.
  • Updated documentation to address inconsistencies.
  • Fixed a crash when passing null Properties to ChatClient.create(). An IllegalStateException will now be thrown instead.
  • Updated log messages to not mention non-existing Channel.synchronize() anymore.
  • Addressed status callback threading issues related to Member.getUserDescriptor()/.getAndSubscribeUser().
  • Ensure that Channel listener's synchronisation status callback immediately upon add in all cases.
  • Added creation of notification payload from FCM RemoteMessage contents.
  • Added a new helper method: Channel.SynchronizationStatus.isAtLeast().

Programmable Chat Android 1.0.4 (June 8, 2017)

Bug Fixes

  • Fixed a bug whereby some commands did not correctly complete - i.e. no success callback nor failure was received. This release fixes cases not addressed by the previous release.
  • Fixed a bug whereby SDK would crash in some circumstances while creating a Chat Client instance.

Programmable Chat Android 1.0.3 (June 2, 2017)

Bug Fixes

  • Fixed a bug whereby client initialization did not completed correctly - i.e. no success nor failure callback was received for client creation
  • Fixed a bug whereby some commands did not correctly complete - i.e. no success callback nor failure was received

Programmable Chat Android 1.0.1 (May 24, 2017)

Bug Fixes

  • Fixed a bug whereby after a call to client.shutdown() sometimes caused New Message push registrations to be lost for the endpoint.

Programmable Chat Android 1.0.0 (May 2, 2017)

Changes are grouped by class to ease migration.

ChatClient changes:

  • changed default log level from Log.DEBUG to Log.WARN
  • previously deprecated initialMessageCount setting has been removed
  • removed functions:
    • int getInitialMessageCount()
    • Builder ChatClient.Builder.setInitialMessageCount(int initialMessageCount)
  • UserInfo has been replaced with User/UserDescriptor and direct getting of UserInfo has been replaced with identity getters.
    • replaced UserInfo getMyUserInfo() with String getMyIdentity()
  • added new function to access user information Users getUsers()

ChatClientListener changes:

  • added new functions:
    • void onUserSubscribed(User user)
    • void onUserUnsubscribed(User user)
  • changed functions:
    • renamed onChannelAdd to onChannelAdded
    • renamed onChannelJoin to onChannelJoined
    • renamed onChannelInvite to onChannelInvited
    • renamed onChannelDelete to onChannelDeleted
    • renamed onToastNotification to onNotification
    • renamed onToastSubscribed to onNotificationSubscribed
    • renamed onToastFailed to onNotificationFailed
    • replaced void onChannelChange(Channel) with void onChannelUpdated(Channel, Channel.UpdateReason reason)
    • replaced void onUserInfoChange(UserInfo userInfo, UserInfo.UpdateReason reason) with void onUserUpdated(User user, User.UpdateReason reason)

Channel changes:

  • added new value for Channel.ChannelStatus enum:
    • UNKNOWN - channels returned in ChannelDescriptor do not have status information
  • added new Channel.UpdateReason enum to indicate reason for channel update, with values:
    • STATUS
    • LAST_CONSUMED_MESSAGE_INDEX
    • UNIQUE_NAME
    • FRIENDLY_NAME
    • ATTRIBUTES
  • removed function (you no longer need to explicitly synchronise channels):
    • void synchronize(CallbackListener<Channel>)

ChannelDescriptor changes:

  • added new functions:
    • long getUnconsumedMessagesCount()
    • Channel.ChannelStatus getStatus()

Channels changes:

  • renamed getPublicChannels to getPublicChannelsList
  • added new functions:
    • void getUserChannelsList(CallbackListener<Paginator<ChannelDescriptor>>)
    • List<Channel> getSubscribedChannels()
    • List<Member> getMembersByIdentity(String identity)

ChannelListener changes:

  • changed functions:
    • renamed onMessageAdd to onMessageAdded
    • renamed onMessageChange to onMessageUpdated
    • renamed onMessageDelete to onMessageDeleted
    • renamed onMemberJoin to onMemberJoined
    • renamed onMemberAdd to onMemberAdded
    • renamed onMemberChange to onMemberUpdated
    • renamed onMemberDelete to onMemberDeleted
    • renamed onSynchronizationChange to onSynchronizationChanged

ErrorInfo changes:

  • added new functions:
    • int getStatus()
    • String toString()
  • changed functions:
    • renamed getErrorCode to getCode
    • renamed getErrorText to getMessage

Member changes:

  • added new functions:
    • void getUserDescriptor(CallbackListener<UserDescriptor> listener)
    • void getAndSubscribeUser(CallbackListener<User> listener)
  • changed function:
    • replaced UserInfo getUserInfo() with String getIdentity()

Members changes:

  • added new functions:
    • Channel getChannel()
    • Member getMember(String identity)
    • void add(Member member, StatusListener listener)
    • void invite(Member member, StatusListener listener)
    • void removeByIdentity(String identity, StatusListener listener)
  • changed functions:
    • replaced void getMembers(CallbackListener<Paginator<Member>> listener) with List<Member> getMembersList()
    • renamed removeMember to remove

User changes:

  • renamed UserInfo to User class
  • added new functions:
    • void unsubscribe()
    • boolean isSubscribed()

UserDescriptor changes:

  • added new class UserDescriptor with functions:
    • String getFriendlyName()
    • JSONObject getAttributes()
    • String getIdentity()
    • boolean isOnline()
    • boolean isNotifiable()
    • subscribe(CallbackListener<User> listener)

Users changes:

  • added new class Users with functions:
    • void getChannelUserDescriptors(String channelSid, CallbackListener<Paginator<UserDescriptor>> listener)
    • void getUserDescriptor(String identity, CallbackListener<UserDescriptor> listener)
    • void getAndSubscribeUser(String identity, CallbackListener<User> listener)
    • List<User> getSubscribedUsers()
    • User getMyUser()

Bug fixes

  • Getting non-existing message by index now properly fails.

Programmable Chat Android 0.12.3 (May 19, 2017)

Bug Fixes

  • Fixed an issue whereby Push Credential registrations were firing onSuccess on each state change
  • Fixed a race condition whereby on channel creation, onChannelAdded and onChannelJoined events failed to fire correctly

Programmable Chat Android 0.12.2 (March 30, 2017)

Changes

  • Added FCM support via ChatClient.registerFCMToken(), ChatClient.unregisterFCMToken()
  • Return a proper error if the internal token and a manual token update causes a mismatch
  • Expose additional error codes to client. ErrorInfo.CANNOT_GET_MESSAGE_BY_INDEX and ErrorInfo.MISMATCHING_TOKEN_UPDATE

Bug Fixes

  • Fixed an issue where a certain character caused a crash \v
  • Added missing Message.getTimeStampAsDate()

Programmable Chat Android 0.12.1 (February 23, 2017)

Changes

  • The endpoint_id identifier specified in access tokens is now automatically generated and persisted in the local app storage. 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
  • Fully asynchronous client init
    • Client listener onError() will be called if any service error happens during client creation.
    • Client will not be created in this case.
  • Initial message count is completely ignored by init code, 0 is always used - messages are loaded when a channel is loaded.
  • Security enhancements

Bug Fixes

  • Added missing Channel.getCreatedBy() and ChannelDescriptor.getCreatedBy() to return creator's identity
  • Fixed a bug whereby a constant CPU load was generated by the SDK client when initialized.

Programmable Chat Android 0.11.2 (December 1, 2016)

Changes

  • Added a call to the onClientSynchronization callback in the registered listener upon ChatClient.setListener(), passing the current client synchronization state

Programmable Chat Android 0.11.1 (November 22, 2016)

Bug Fixes

  • Fixed an issue where the getPublicChannels() caused a crash

Programmable Chat Android 0.11.0 (November 21, 2016)

BREAKING

  • Rename IP Messaging to Programmable Chat
  • IPMessagingClient is renamed to ChatClient
  • com.twilio.ipmessaging is renamed to com.twilio.chat
  • AccessManager is removed from SDK

ADDED

  • Channel.removeAllListeners() removes all added listeners.
  • Channel.getMessagesCount()
  • Channel.getUnconsumedMessagesCount()
  • Channel.getMembersCount()
  • Channels.getPublicChannels() returns ChannelDescriptors, and this list is not updated in realtime.
  • onUserInfoUpdated added UpdateReason.

CHANGED

  • BREAKING Do not return IPMessagingClient before it was fully initialised. IPMessagingClient.create() no longer returns a value, you can obtain reference to created IPMessagingClient only in listener's onSuccess() callback.

  • BREAKING Channel.setListener() replaced with addListener() to support assigning multiple listeners

  • BREAKING Channel.removeListener() now accepts listener ptr to remove only that one
  • BREAKING Replace custom CreateChannelListener in Channels.createChannel() with generic CallbackListener<Channel>. Listener's onCreated(Channel) is therefore renamed onSuccess(Channel).

  • BREAKING IPMessagingClient.handleNotification() now accepts NotificationPayload instead of Map<String,String>

  • BREAKING Messages.getMessageByIndex() has been changed to asynchronous interface.

  • BREAKING Members.getMembers() has been changed to asynchronous interface.

  • BREAKING Channel invite logic changes.

  • BREAKING Constants interface is removed, StatusListener and CallbackListener<T> are standalone classes now.

DELETED

  • BREAKING Removed built-in AccessManager, IPMessagingClient.create() now accepts only String token. IPMessagingClient.updateToken() is provided to update it.
  • Use com.twilio:accessmanager-android:0.1.0 from jcenter
  • Removed twilio-common from dependencies.

  • BREAKING Remove previously obsoleted ChannelListener.onAttributesChange()

  • BREAKING Remove previously deprecated Channels.createChannel() with attributes map.

  • BREAKING Remove previously deprecated TwilioIPMessagingSDK

  • BREAKING Remove previously deprecated InitListener

  • BREAKING Remove previously deprecated Messages.getMessages()

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 browsing the Twilio tag on Stack Overflow.