# Changelog: Twilio Chat Android SDK 4.x

> \[!NOTE]
>
> If you are starting out with Twilio's Programmable Chat SDK for Android, we highly recommend starting with version 7.x. Version 7.x is our latest SDK and it brings many new features and improvements to the earliest versions. And it will be much easier to [migrate to Twilio Conversations](/docs/conversations/migrating-chat-conversations).

> \[!WARNING]
>
> **Not using 7.x? You should migrate ASAP**
>
> If you are already using 4.x, we highly recommend planning your migration to 7.x as soon as possible.
>
> **End-of-Life for 1.x occurred on June 30, 2019.**

### Programmable Chat Android 4.2.9 *(Jan 21, 2020)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.9%2Fchat-android-4.2.9.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.9/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.9%2Fchat-android-4.2.9-javadoc.jar)

#### Changes

* Fixed a bug when channel attributes are empty when `onChannelAdded` called after re-joining to private channel.

***

### Programmable Chat Android 4.2.8 *(Jan 10, 2020)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.8%2Fchat-android-4.2.8.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.8/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.8%2Fchat-android-4.2.8-javadoc.jar)

#### Changes \[#changes-2]

* Fixed a bug when channel attributes are empty when `onChannelAdded` called.
* Reduced SDK footprint.

***

### Programmable Chat Android 4.2.7 *(Dec 4, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.7%2Fchat-android-4.2.7.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.7/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.7%2Fchat-android-4.2.7-javadoc.jar)

#### Changes \[#changes-3]

* Errors are now more human-readable for debugging purposes.
* Fixed a bug related to `joinChannel` callback. Sometimes was not called.
* Improved logging.

***

### Programmable Chat Android 4.2.6 *(Nov 18, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.6%2Fchat-android-4.2.6.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.6/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.6%2Fchat-android-4.2.6-javadoc.jar)

#### Changes \[#changes-4]

* Fixed a native crash in `makeUserDescriptor()`.
* Fixed a bug where `isOnline()` and `isNotifiable()` in `TMUserDescriptor` always returned `false`.
* Fixed processing failed result in consumption horizon.
* Fixed a bug where calling `add` or `invite` members double callbacks while offline.
* Fixed deadlock in `getChannel()`.

***

### Programmable Chat Android 4.2.5 *(Oct 18, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.5%2Fchat-android-4.2.5.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.5/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.5%2Fchat-android-4.2.5-javadoc.jar)

#### Changes \[#changes-5]

* Minimum Android SDK version decreased to 19.
* Fixed a bug where `getAndSubscribeUser()` method doesn't work anymore after calling `User.unsubscribe()`.

***

### Programmable Chat Android 4.2.4 *(Oct 14, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.4/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4-javadoc.jar)

#### Changes \[#changes-6]

* Fixed a bug that caused an excessive subscription retry loop on failure, which would lead to an increased network and battery consumption.
* Fixed a bug where `getMessageByIndex()` sometimes resulted in `Could not retrieve Message by index` error when messages were not cached.
* Included a valid ProGuard configuration with the SDK archive (AAR).
* Improved documentation on getMessagesAfter/Before behavior.

***

### Programmable Chat Android 4.2.3 *(deprecated, please use 4.2.4)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.4/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4-javadoc.jar)

#### Changes \[#changes-7]

* Fixed a bug where an incorrect message index was received in `ChatClientListener.onNewMessageNotification()` after calling `ChatClient.handleNotification()`.

***

### Programmable Chat Android 4.2.2 *(deprecated, please use 4.2.4)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.4/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4-javadoc.jar)

#### Changes \[#changes-8]

* Reduced SDK footprint, resulting in a noticeable decrease in final application size compared to release 4.2.0.

### Programmable Chat Android 4.2.1 *(deprecated, please use 4.2.4)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.4/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.4%2Fchat-android-4.2.4-javadoc.jar)

#### Changes \[#changes-9]

* Fixed stack dump symbolication on Сrashlytics. In order to make the symbolication work, we needed to reconfigure linker which led to increase of SDK footprint by 10%. We are working hard on reducing the SDK size in next releases.
* Fixed retrieving member attributes when invoked immediately after client initialization.

***

### Programmable Chat Android 4.2.0 *(Aug 6, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.0%2Fchat-android-4.2.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.2.0/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.2.0%2Fchat-android-4.2.0-javadoc.jar)

#### Changes \[#changes-10]

* Added the `Member.getType()` method to obtain information about the type of a member (chat/sms/whatsapp/other).
* Fixed a misleading error message when fetching a user descriptor for a user-less member, or subscribing to a user-less member.

***

### Programmable Chat Android 4.1.2 *(July 26, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.1.2%2Fchat-android-4.1.2.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.1.2/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.1.2%2Fchat-android-4.1.2-javadoc.jar)

#### Changes \[#changes-11]

* Fixed a race condition when invoking `ChannelListener.onTypingStarted()` / `.onTypingEnded()`.

***

### Programmable Chat Android 4.1.1 *(July 25, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.1.1%2Fchat-android-4.1.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.1.1/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.1.1%2Fchat-android-4.1.1-javadoc.jar)

#### Changes \[#changes-12]

* Fixed a bug when removing a Member from Channel.

***

### Programmable Chat Android 4.1.0 *(July 9, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.1.0%2Fchat-android-4.1.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.1.0/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.1.0%2Fchat-android-4.1.0-javadoc.jar)

#### Changes \[#changes-13]

* Added `Message.getMemberSid()` and `Message.getMember()` methods to obtain information about the author of a message.

***

### Programmable Chat Android 4.0.5 *(June 26, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.5%2Fchat-android-4.0.5.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.0.5/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.5%2Fchat-android-4.0.5-javadoc.jar)

#### Bug Fixes

* Improved stability on shutdown, fixed crash issue.
* Fixed memory leaks in media upload.
* Fixed crash on media download in bad networking conditions.

***

### Programmable Chat Android 4.0.4 *(April 11, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.4%2Fchat-android-4.0.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.0.4/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.4%2Fchat-android-4.0.4-javadoc.jar)

#### Bug Fixes \[#bug-fixes-2]

* Improved connection reliability under bad network conditions.
* Fixed unexpected connectivity errors with code 1401: Unable to establish connection to Twilio Sync service.
* Fixed behavior for `UpdateAttributes` in `Message` and `User`, now updating with null value calls listener's `onError()`.
* Improved documentation for Channel Members.

#### Breaking changes

* Increased targetSdkVersion to 28 in preparation for Google SDK policy targeted in August; minSdkVersion remains 21.

***

### Programmable Chat Android 4.0.3 *(February 19, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.3%2Fchat-android-4.0.3.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.0.3/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.3%2Fchat-android-4.0.3-javadoc.jar)

#### Bug Fixes \[#bug-fixes-3]

* SDK size reduction - it gained over the course of the year, so we sent it to the gym. Native libraries are now repackaged and optimized for size.

***

### Programmable Chat Android 4.0.2 *(January 23, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.2%2Fchat-android-4.0.2.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/4.0.2/docs/)
[javadocs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.2%2Fchat-android-4.0.2-javadoc.jar)

#### Bug Fixes \[#bug-fixes-4]

* Fixed crash on shutdown

***

### Programmable Chat Android 4.0.1 *(January 21, 2019)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.1%2Fchat-android-4.0.1.aar)
[docs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.1%2Fchat-android-4.0.1-javadoc.jar)

#### Bug Fixes \[#bug-fixes-5]

* Fixed crash on restoring after disconnected or backgrounded state
* Fixed memory leaks in media upload

***

### Programmable Chat Android 4.0.0 *(December 10, 2018)*

[aar](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.0%2Fchat-android-4.0.0.aar)
[docs](https://bintray.com/twilio/releases/download_file?file_path=com%2Ftwilio%2Fchat-android%2F4.0.0%2Fchat-android-4.0.0-javadoc.jar)

#### Breaking Changes

* Removed previously deprecated `Message.getTimeStampAsDate()`. Use `Message.getDateCreatedAsDate()` instead.

#### Bug Fixes \[#bug-fixes-6]

* Calling `ChatClient.updateToken()` may now indicate an error to the listener if the token validation failed.

#### Changes \[#changes-14]

* Introduced Push Notification Muting, with per-channel user notification preferences.

  * Added `Channel.getNotificationLevel()` and `Channel.setNotificationLevel(NotificationLevel, StatusListener)`.
  * Added `Channel.NotificationLevel` enum with values `.DEFAULT` to receive notifications and `.MUTED` to suppress them. Upon leaving the channel, the mute setting for this User is reset to `.DEFAULT`.
  * Added `Channel.UpdateReason.NOTIFICATION_LEVEL` enum value when notification level changes.
  * NOTE: You need to grant `editNotificationLevel` permission to the user roles to be able to change this setting. See the [Chat Permissions documentation](/docs/chat/permissions).
* Added new token lifecycle management delegate callbacks which reduce the need for AccessManager integration when only using one Twilio client SDK:

  * `ChatClientListener.onTokenAboutToExpire()` is called when a token has 3 minutes or less left until expiry and should be refreshed.
  * `ChatClientListener.onTokenExpired()` is called when a token is already expired and must be refreshed to reconnect to the service.
* New logging level `android.log.LogLevel.VERBOSE` is now supported. Use this value to generate logs when reporting SDK issues to Twilio. As before, the default log setting is `.SILENT`, producing no SDK debug output at all.
* Added `Member.UpdateReason.ATTRIBUTES` enum value. There's currently no way to query member attributes, it will be added in the following SDK version.
* Added logging of `android.os.Build.{BOARD,BRAND,DEVICE,DISPLAY,FINGERPRINT,HARDWARE,MANUFACTURER,MODEL,PRODUCT}` on ChatClient startup - this data is logged into the local android log only and is helpful in diagnosing problems, please include it when submitting logs in bug reports!
* Added @NonNull annotations to methods in `Messages` class.
* Overhauled transport and communication layer, significantly improving network traffic overhead and client performance.
* Provided numerous fixes for improving client stability, focusing on runtime and shutdown crashes.

***

### Programmable Chat Android 3.1.1 *(June 19, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/3.1.1/twilio-chat-android-3.1.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/3.1.1/docs/)

#### Bug Fixes \[#bug-fixes-7]

* Resolve [crash on shutting down](https://github.com/twilio/twilio-chat-demo-android/issues/28) on Oreo devices.
* Resolve crash on shutdown after calling `getLastMessages()`.

### Programmable Chat Android 3.1.0 *(June 7, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/3.1.0/twilio-chat-android-3.1.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/3.1.0/docs/)

#### Deprecations

* Deprecated `Message.getTimeStampAsDate()`, use `Message.getDateCreatedAsDate()` instead.

#### Changes \[#changes-15]

* Added `Channels.getSubscribedChannelsSortedBy()` to obtain a list of subscribed channels sorted based on a few available criteria: `Channel.SortCriterion.LAST_MESSAGE`, `Channel.SortCriterion.FRIENDLY_NAME`, `Channel.SortCriterion.UNIQUE_NAME`.
* Added `Channel.getLastMessageDate()` and `Channel.getLastMessageIndex()` to obtain information about last message activity in the channel.
* Added `Channel.UpdateReason.LAST_MESSAGE` for last channel message change, you can inspect the two above-mentioned properties of the `Channel` after receiving this update for new values.

#### Bug Fixes \[#bug-fixes-8]

* Resolve crash on accessing last messages in the Channel after some patterns of message deletion.
* Fix local reference table overflow when clearing more than 512 objects from cache.

### Programmable Chat Android 3.0.1 *(May 22, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/3.0.1/twilio-chat-android-3.0.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/3.0.1/docs/)

#### Changes \[#changes-16]

* Made disposed object checks non-fatal - they only log an ERROR level message now.

#### Bug Fixes \[#bug-fixes-9]

* You must now request at least 1 message from the channel in `Messages.getLastMessages()` query. It used to be possible to query for 0 messages and receive no results, but not anymore.
* GDPR-compliance by default - uses log level SILENT to not output anything from SDK by default. Switch to higher debug level using `ChatClient.setLogLevel()` to receive log messages.

### Programmable Chat Android 3.0.0 *(April 10, 2018)*

This version is a major version bump due to [semver](https://semver.org). There are a number of incompatible API changes making this bump necessary.

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/3.0.0/twilio-chat-android-3.0.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/3.0.0/docs/)

#### Breaking Changes \[#breaking-changes-2]

These updates have changed the API in a backwards-incompatible manner.

* `ChannelListener.onTypingStarted/onTypingEnded` methods now include a Channel in which this event has happened in the signature.
* Chat messages that include media content previously returned a placeholder string "Media messages are not supported". This has caused some confusion, so these messages now return `null` body instead. Be careful to handle this case properly because it may cause NPEs in the your application if you don't.
* `Message.getTimeStamp` has been renamed `Message.getDateCreated` for clarity. The returned value has not changed.
* `ChatClientListener.onNotification()` method for receiving push notifications has been split into 4 separate methods:
  * `onNewMessageNotification(String channelSid, String messageSid, long messageIndex)`
  * `onAddedToChannelNotification(String channelSid)`
  * `onInvitedToChannelNotification(String channelSid)`
  * `onRemovedFromChannelNotification(String channelSid)`
    Now the parameters to these methods are more logical - for example there's no messageSid parameter when it is unused. The new `messageIndex` parameter provides an easier interface if you need to scroll to a message in the channel from push notification.
* Behavior of `Channel.join` and `Members.add/addByIdentity` has changed - methods will *fail* if user is already a member of the channel.
* Previously deprecated methods are now removed:
  * `Messages.advanceLastConsumedMessageIndex()`, use `advanceLastConsumedMessageIndexWithResult()` instead.
  * `Messages.setLastConsumedMessageIndex()`, use `setLastConsumedMessageIndexWithResult()` instead.
  * `Messages.setAllMessagesConsumed()`, use `setAllMessagesConsumedWithResult()` instead.
  * `Messages.setNoMessagesConsumed()`, use `setNoMessagesConsumedWithResult()` instead.

#### Changes \[#changes-17]

* Media queueing support has been added for media messages, to better utilize upload bandwidth.
* Online documentation format has changed to a more usable one (with search).

#### Bug Fixes \[#bug-fixes-10]

* CallbackListener for `ChatClient.create` will be called on the originating thread. Previously it was called from library thread by mistake.
* Android CA store certificates can be used for connections where possible. This means custom company certificates added on devices should now be honored by the SDK. To enable this feature use ChatClient.Properties.Builder's `setDeferCertificateTrustToPlatform(boolean)` with value `true`. By default Twilio-pinned certificate bundle will be used.
* `ChatClientListener.onChannelAdded()` will be called regardless of if the channel's status is known yet or not, it was not called before if channel status was not yet determined.
* Various internal bugfixes.

### Programmable Chat Android 2.0.11 *(May 24, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.11/twilio-chat-android-2.0.11.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.8/docs/)

#### Bug Fixes \[#bug-fixes-11]

* Fixed crash on shutdown due to local reference table overflow.
* Made disposed object checks non-fatal - they only log an ERROR level message now.

### Programmable Chat Android 2.0.10 *(internal release, skipped)*

### Programmable Chat Android 2.0.9 *(internal release, skipped)*

### Programmable Chat Android 2.0.8 *(February 9, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.8/twilio-chat-android-2.0.8.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.8/docs/)

#### Bug Fixes \[#bug-fixes-12]

* Fixed possible crash on shutdown.

### Programmable Chat Android 2.0.7 *(February 5, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.7/twilio-chat-android-2.0.7.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.7/docs/)

#### Changes \[#changes-18]

* Updated internal certificate store for upcoming certificate authority changes.

### Programmable Chat Android 2.0.6 *(January 29, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.6/twilio-chat-android-2.0.6.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.6/docs/)

#### Bug Fixes \[#bug-fixes-13]

* Forward current connection state to the newly added listener. It's impossible to lose client connection state change between client creation and listener assignment now.
* Implement better multithreading in channel listener callbacks. It's now more robust during concurrent modifications to the channel listeners list.

### Programmable Chat Android 2.0.5 *(January 10, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.5/twilio-chat-android-2.0.5.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.5/docs/)

#### Bug Fixes \[#bug-fixes-14]

* Optimized SDK speed.
* Optimized SDK size.
* Improved stability.

### Programmable Chat Android 2.0.4 *(December 19, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.4/twilio-chat-android-2.0.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.4/docs/)

#### Bug Fixes \[#bug-fixes-15]

* Added back the javadocs that went missing after 2.0.3-rc3

### Programmable Chat Android 2.0.3 *(December 14, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.3/twilio-chat-android-2.0.3.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.3/docs/)

#### Bug Fixes \[#bug-fixes-16]

* Fixed an issue where shutting down ChatClient on Android Oreo devices (8.0+) could crash.

### Programmable Chat Android 2.0.2 *(November 9, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.2/twilio-chat-android-2.0.2.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.2/docs/)

#### Bug Fixes \[#bug-fixes-17]

* 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 \[#changes-19]

* 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 \[#deprecations-2]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.1/twilio-chat-android-2.0.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.1/docs/)

#### Bug Fixes \[#bug-fixes-18]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.0/twilio-chat-android-2.0.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/2.0.0/docs/)

#### New Features

* Added Multimedia Messaging (beta) API (see [Media Support](/docs/chat/media-support) for more information). *Note:* Sending media messages on existing instances requires [adding a new permission in your channel roles](/docs/chat/media-support#required-role-permission).
  * Added Message.Media, Message.getType().

#### Changes \[#changes-20]

* BREAKING: Added `UpdateReason`s to onMessageUpdated and onMemberUpdated callbacks.
* BREAKING: Removed the deprecated enum `SynchronizationStrategy`.
* BREAKING: Use `Message.Options` to construct and `sendMessage()`
  * You now could fully initialize 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 \[#bug-fixes-19]

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

***

### Programmable Chat Android 1.0.14 *(February 5, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.14/twilio-chat-android-1.0.14.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.14/docs/)

#### Changes \[#changes-21]

* Updated internal certificate store for upcoming certificate authority changes.

### Programmable Chat Android 1.0.13 *(January 10, 2018)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.13/twilio-chat-android-1.0.13.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.13/docs/)

#### Bug Fixes \[#bug-fixes-20]

* Optimized SDK speed.
* Optimized SDK size.
* Improved stability.

### Programmable Chat Android 1.0.12 *(December 19, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.12/twilio-chat-android-1.0.12.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.12/docs/)

#### Bug Fixes \[#bug-fixes-21]

* Fixed an issue where shutting down ChatClient on Android Oreo devices (8.0+) could crash.
* Fixed an issue where already disposed ChatClient would attempt to reconnect on application foregrounding.
* Fixed a potential issue where ChatClient could not release some resources on shutdown.
* Add logging of application backgrounding and foregrounding events to improve debugging.

### Programmable Chat Android 1.0.11 *(October 11, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.11/twilio-chat-android-1.0.11.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.11/docs/)

#### Bug Fixes \[#bug-fixes-22]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.10/twilio-chat-android-1.0.10.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.10/docs/)

#### Changes \[#changes-22]

* Performance enhancements for client startup and data retrieval.

### Programmable Chat Android 1.0.9 *(July 25, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.9/twilio-chat-android-1.0.9.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.9/docs/)

#### Bug Fixes \[#bug-fixes-23]

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

***

### Programmable Chat Android 1.0.8 *(July 5, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.8/twilio-chat-android-1.0.8.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.8/docs/)

#### Bug Fixes \[#bug-fixes-24]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.7/twilio-chat-android-1.0.7.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.7/docs/)

#### Bug Fixes \[#bug-fixes-25]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.6/twilio-chat-android-1.0.6.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.6/docs/)

#### Bug Fixes \[#bug-fixes-26]

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

***

### Programmable Chat Android 1.0.5 *(June 20, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.5/twilio-chat-android-1.0.5.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.5/docs/)

#### Bug Fixes \[#bug-fixes-27]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.4/twilio-chat-android-1.0.4.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.4/docs/)

#### Bug Fixes \[#bug-fixes-28]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.3/twilio-chat-android-1.0.3.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.3/docs/)

#### Bug Fixes \[#bug-fixes-29]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.1/twilio-chat-android-1.0.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.1/docs/)

#### Bug Fixes \[#bug-fixes-30]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.0/twilio-chat-android-1.0.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/1.0.0/docs/)

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 synchronize 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/0.12.3/twilio-chat-android-0.12.3.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/0.12.3/docs/)

#### Bug Fixes \[#bug-fixes-31]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/0.12.2/twilio-chat-android-0.12.2.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/0.12.2/docs/)

#### Changes \[#changes-23]

* 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 \[#bug-fixes-32]

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

***

### Programmable Chat Android 0.12.1 *(February 23, 2017)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/0.12.1/twilio-chat-android-0.12.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/0.12.1/docs/)

#### Changes \[#changes-24]

* 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 \[#bug-fixes-33]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/0.11.2/twilio-chat-android-0.11.2.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/0.11.2/docs/)

#### Changes \[#changes-25]

* 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)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/0.11.1/twilio-chat-android-0.11.1.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/0.11.1/docs/)

#### Bug Fixes \[#bug-fixes-34]

* Fixed an issue where the `getPublicChannels()` caused a crash

***

### Programmable Chat Android 0.11.0 *(November 21, 2016)*

[aar](https://media.twiliocdn.com/sdk/android/chat/releases/0.11.0/twilio-chat-android-0.11.0.aar)
[docs](https://media.twiliocdn.com/sdk/android/chat/releases/0.11.0/docs/)

#### 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 `ChannelDescriptor`s, and this list is not updated in realtime.
* `onUserInfoUpdated` added UpdateReason.

#### CHANGED

* **BREAKING** Do not return IPMessagingClient before it was fully initialized.
  `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()`
