# Android SDK v6.0.0 Migration Guide

### Live Objects / Live Collections Changes

As announced here, [Deprecation announcements](https://docs.amity.co/#rxjava2-and-pagedlist-deprecation-notice), this version replaces PagedList and RxJava2 with PagingData and RxJava3.

Live capability has been upgraded with RxJava3. Include RxJava3 to your project with this guide, [RxJava Getting Started](https://github.com/ReactiveX/RxJava), or use SDK’s extension function to Rx2() to bridge the SDK functions back to RxJava2.

The Paginated collection has been upgraded with PagingData. To consume PaginData, replace Android’s PagedListAdapter with PagingDataAdapter following this guide, [Paging V3 migration](https://developer.android.com/topic/libraries/architecture/paging/v3-migration).

### Behaviour Changes

#### Channel

**Create**

Channel creation with custom id is no longer supported

#### Message

**Query**

Message query from channel is no longer supported. Messages from each channel are migrated to the corresponding channel’s default sub-channel. Refer to Subchannel feature documentation.

StackFromEnd option is no longer supported. To achieve Chat room behaviour, use `sortyBy()` with the value `AmityMessageQuerySortOption.LAST_CREATED` and reverse the RecyclerView.

**Create**

Message creation on the channels is no longer supported. Messages must be created on Subchannels only. Refer to Subchannel feature documentation.

**RTE**

Automatic subscription to messages on Live and Broadcast channels is no longer supported. To receive real time updates on these channels, explicitly subscribe to the channel. Refer to RTE documentation.

#### Comment

**Create**

Comment creation with a custom id is no longer supported.

### Package Changes

All SDK classes are required to be newly imported into your project as API classes are relocated to *com.amity.socialcloud.sdk.api* and model classes are relocated to *com.amity.socialcloud.sdk.model*

### Interface Changes

### API

**AmityChannelRepository**

<table><thead><tr><th width="267.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>createChannel()</code></td><td><code>createChannel(displayName: String)</code></td><td><p>Channel creation with custom id is no longer supported.</p><p>Channel creation requires displayName</p></td></tr><tr><td><code>fetchChannel(channelId: String)</code></td><td>Removed</td><td>Use <code>getChannel(channelId: String)</code> instead</td></tr><tr><td><code>observeChannel(channelId: String)</code></td><td>Removed</td><td>Use <code>getChannel(channelId: String)</code> instead</td></tr><tr><td><code>getTotalUnreadCount()</code></td><td><code>AmityChannel.getDefaultSubChannelUnreadCount()</code></td><td></td></tr></tbody></table>

**AmityChannelParticipation**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td>startReading()</td><td>Removed</td><td></td></tr><tr><td>stopReading()</td><td>Removed</td><td></td></tr></tbody></table>

**AmityChannelMembershipQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="390">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityChannelMemberSearch**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="390">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityMessageRepository**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="394">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>createMessage(channelId: String)</code></td><td>createMessage(subChannelId: String)</td><td></td></tr><tr><td><code>getMessages(channelId: String)</code></td><td>getMessages(subChannelId: String)</td><td></td></tr></tbody></table>

**AmityMessageQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="394">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

**AmityMessageQuery.Builder**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="173">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>stackFromEnd(stackFromEnd: Boolean)</code></td><td>Removed</td><td>Use <code>sortBy(sortOption: AmityMessageQuerySortOption)</code> instead</td></tr></tbody></table>

**AmityMessageReactionQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="400">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityCoreClient**

<table><thead><tr><th width="268.3333333333333">Methods</th><th width="138">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>setup(apiKey: String, httpEndpoint: String, socketEndpoint: String)</code></td><td>Removed</td><td><p>Use</p><p><code>setup(apiKey: String, endpoint: AmityEndpoint)</code> instead.</p><p>For custom endpoint, use <code>AmityEndpoint.CUSTOM()</code></p></td></tr><tr><td><code>unregisterDeviceForPushNotification(userId: String)</code></td><td>Removed</td><td>Use <code>unregisterDeviceForPushNotification()</code> instead</td></tr></tbody></table>

**AmityFileRepository**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="265">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>uploadAudio(uri : Uri)</code></td><td><p>Return</p><p><code>Flowable&#x3C;AmityUploadResult&#x3C;AmityAudio>></code> instead of</p><p><code>AmityAudioUploadService.Builder</code></p></td><td></td></tr><tr><td><code>uploadFile(uri: Uri)</code></td><td><p>Return</p><p><code>Flowable&#x3C;AmityUploadResult&#x3C;AmityFile>></code> instead of</p><p><code>AmityFileUploadService.Builder</code></p></td><td></td></tr><tr><td><code>uploadImage(uri: Uri)</code></td><td><p>Return</p><p><code>Flowable&#x3C;AmityUploadResult&#x3C;AmityImage>></code> instead of</p><p><code>AmityImageUploadService.Builder</code></p></td><td></td></tr><tr><td><code>uploadVideo(uri: Uri)</code></td><td>Removed</td><td>Use <code>uploadVideo(uri: Uri, contentFeedType: AmityContentFeedType)</code> instead</td></tr><tr><td><code>uploadVideo(uri: Uri, contentFeedType: AmityContentFeedType)</code></td><td><p>Return</p><p><code>Flowable&#x3C;AmityUploadResult&#x3C;AmityVideo>></code> instead of</p><p><code>AmityVideoUploadService.Builder</code></p></td><td></td></tr></tbody></table>

**AmityMyFollowersQuery**

<table><thead><tr><th width="207.33333333333331">Methods</th><th width="401">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityMyFollowingsQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="346">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

**AmityUserFollowersQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="349">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityUserFollowingsQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="354">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityUserQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="359">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityUserSearch**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="366">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityUserNotification**

<table><thead><tr><th width="269.3333333333333">Methods</th><th width="207">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>setAllowed(isAllowed: Boolean)</code></td><td>Removed</td><td>Use <code>enable()</code> or <code>disable()</code> instead</td></tr><tr><td><code>isAllowed</code></td><td>Removed</td><td>Use <code>getSettings()</code> instead</td></tr></tbody></table>

**AmityUserUpdate**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>update()</code></td><td><code>apply()</code></td><td></td></tr></tbody></table>

**AmityCommunityCategoryQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityCommentRepository**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>observeComment(commentId: String)</code></td><td><code>getComment(commentId: String)</code></td><td></td></tr><tr><td><code>createComment(commentId: String)</code></td><td>Removed</td><td>Comment creation with custom id is no longer supported</td></tr><tr><td><code>deleteComment(commentId: String)</code></td><td><code>softDeleteComment(commentId: String)</code></td><td></td></tr><tr><td><code>deleteComment(commentId: String, hardDelete: Boolean)</code></td><td><code>hardDeleteComment(commentId: String)</code></td><td></td></tr></tbody></table>

**AmityCommentReactionQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityCommunityQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityCommunityModeration**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>addRole(role: String, userIds: List)</code></td><td>Removed</td><td><p>Use <code>addRoles(role: List&#x3C;String>), userIds: List&#x3C;String>)</code></p><p>instead</p></td></tr><tr><td><code>removeRole(role: String, userIds: List)</code></td><td>Removed</td><td><p>Use <code>removeRoles(role: List&#x3C;String>), userIds: List&#x3C;String>)</code></p><p>instead</p></td></tr></tbody></table>

**AmityMembershipQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityCommunityMembershipSearch**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityFeedRepository**

<table><thead><tr><th width="236.33333333333331">Methods</th><th width="256">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>createPost()</code></td><td>Removed</td><td>Use equivalent method in AmityPostRepository instead</td></tr><tr><td><code>getPost(postId: String)</code></td><td>Removed</td><td>Use equivalent method in AmityPostRepository instead</td></tr><tr><td><code>deletePost(postId: String)</code></td><td>Removed</td><td>Use equivalent method in AmityPostRepository instead</td></tr><tr><td><code>reviewPost(postId: String)</code></td><td>Removed</td><td>Use equivalent method in AmityPostRepository instead</td></tr><tr><td><code>getReactions(postId: String)</code></td><td>Removed</td><td>Use equivalent method in AmityPostRepository instead</td></tr><tr><td><code>getComments(postId: String)</code></td><td>Removed</td><td>Use equivalent method in AmityPostRepository instead</td></tr></tbody></table>

**AmityPostRepository**

<table><thead><tr><th width="308.3333333333333">Methods</th><th width="305">Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>deletePost(postId: String)</code></td><td><code>softDeletePost(postId: String)</code></td><td></td></tr><tr><td><code>deletePost(postId: String, hardDelete: Boolean)</code></td><td><code>hardDeletePost(postId: String)</code></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

**AmityCommunityPostQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityUserPostQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityGlobalFeedQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

**AmityCustomRankingGlobalFeedQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityPostReactionQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>query()</code></td><td>Return Flowable&#x3C;PagingData&#x3C;X>> instead of Flowable&#x3C;PagedList&#x3C;X>></td><td></td></tr><tr><td><code>getPagingData()</code></td><td>Removed</td><td></td></tr></tbody></table>

**AmityStreamRepository**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getStream(streamId: String)</code></td><td>Removed</td><td>Use <code>observeStream(streamId: String)</code> instead</td></tr></tbody></table>

**AmityStreamQuery**

<table><thead><tr><th width="236.33333333333331">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getStream(streamId: String)</code></td><td>Removed</td><td>Use <code>observeStream(streamId: String)</code> instead</td></tr></tbody></table>

### **Model**

**AmityChannel**

<table><thead><tr><th width="261.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getUnreadCount()</code></td><td><code>getDefaultSubChannelUnreadCount()</code></td><td></td></tr><tr><td><code>hasUnreadMention()</code></td><td><code>hasDefaultSubChannelUnreadMention()</code></td><td></td></tr></tbody></table>

**AmityMessage**

<table><thead><tr><th width="261.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getChannelSegment()</code></td><td><code>getSegment()</code></td><td></td></tr><tr><td><code>getChildrenNumber()</code></td><td><code>getChildCount()</code></td><td></td></tr><tr><td><code>getUser()</code></td><td><code>getCreator()</code></td><td></td></tr><tr><td><code>getUserId()</code></td><td><code>getCreatorId()</code></td><td></td></tr></tbody></table>

**AmityComment**

<table><thead><tr><th width="261.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getChildrenNumber()</code></td><td><code>getChildCount()</code></td><td></td></tr><tr><td><code>getUser()</code></td><td><code>getCreator()</code></td><td></td></tr><tr><td><code>getUserId()</code></td><td><code>getCreatorId()</code></td><td></td></tr></tbody></table>

**AmityCommunity**

<table><thead><tr><th width="261.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getUser()</code></td><td><code>getCreator()</code></td><td></td></tr><tr><td><code>getUserId()</code></td><td><code>getCreatorId()</code></td><td></td></tr></tbody></table>

**AmityPost**

<table><thead><tr><th width="261.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getUser()</code></td><td><code>getCreator()</code></td><td></td></tr><tr><td><code>getUserId()</code></td><td><code>getCreatorId()</code></td><td></td></tr></tbody></table>

**AmityStream**

<table><thead><tr><th width="261.3333333333333">Methods</th><th>Changes</th><th>Remarks</th></tr></thead><tbody><tr><td><code>getUser()</code></td><td><code>getCreator()</code></td><td></td></tr></tbody></table>
