Android SDK v6.0.0 Migration Guide

This guide is to provide information about breaking changes and how to migrate to the AmitySDK Android 6.0.0 version.

Live Objects / Live Collections Changes

As announced here, Deprecation announcements, 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, 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.

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

Methods
Changes
Remarks

createChannel()

createChannel(displayName: String)

Channel creation with custom id is no longer supported.

Channel creation requires displayName

fetchChannel(channelId: String)

Removed

Use getChannel(channelId: String) instead

observeChannel(channelId: String)

Removed

Use getChannel(channelId: String) instead

getTotalUnreadCount()

AmityChannel.getDefaultSubChannelUnreadCount()

AmityChannelParticipation

Methods
Changes
Remarks

startReading()

Removed

stopReading()

Removed

AmityChannelMembershipQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityChannelMemberSearch

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityMessageRepository

Methods
Changes
Remarks

createMessage(channelId: String)

createMessage(subChannelId: String)

getMessages(channelId: String)

getMessages(subChannelId: String)

AmityMessageQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityMessageQuery.Builder

Methods
Changes
Remarks

stackFromEnd(stackFromEnd: Boolean)

Removed

Use sortBy(sortOption: AmityMessageQuerySortOption) instead

AmityMessageReactionQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityCoreClient

Methods
Changes
Remarks

setup(apiKey: String, httpEndpoint: String, socketEndpoint: String)

Removed

Use

setup(apiKey: String, endpoint: AmityEndpoint) instead.

For custom endpoint, use AmityEndpoint.CUSTOM()

unregisterDeviceForPushNotification(userId: String)

Removed

Use unregisterDeviceForPushNotification() instead

AmityFileRepository

Methods
Changes
Remarks

uploadAudio(uri : Uri)

Return

Flowable<AmityUploadResult<AmityAudio>> instead of

AmityAudioUploadService.Builder

uploadFile(uri: Uri)

Return

Flowable<AmityUploadResult<AmityFile>> instead of

AmityFileUploadService.Builder

uploadImage(uri: Uri)

Return

Flowable<AmityUploadResult<AmityImage>> instead of

AmityImageUploadService.Builder

uploadVideo(uri: Uri)

Removed

Use uploadVideo(uri: Uri, contentFeedType: AmityContentFeedType) instead

uploadVideo(uri: Uri, contentFeedType: AmityContentFeedType)

Return

Flowable<AmityUploadResult<AmityVideo>> instead of

AmityVideoUploadService.Builder

AmityMyFollowersQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityMyFollowingsQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityUserFollowersQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityUserFollowingsQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityUserQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityUserSearch

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityUserNotification

Methods
Changes
Remarks

setAllowed(isAllowed: Boolean)

Removed

Use enable() or disable() instead

isAllowed

Removed

Use getSettings() instead

AmityUserUpdate

Methods
Changes
Remarks

update()

apply()

AmityCommunityCategoryQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityCommentRepository

Methods
Changes
Remarks

observeComment(commentId: String)

getComment(commentId: String)

createComment(commentId: String)

Removed

Comment creation with custom id is no longer supported

deleteComment(commentId: String)

softDeleteComment(commentId: String)

deleteComment(commentId: String, hardDelete: Boolean)

hardDeleteComment(commentId: String)

AmityCommentReactionQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityCommunityQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityCommunityModeration

Methods
Changes
Remarks

addRole(role: String, userIds: List)

Removed

Use addRoles(role: List<String>), userIds: List<String>)

instead

removeRole(role: String, userIds: List)

Removed

Use removeRoles(role: List<String>), userIds: List<String>)

instead

AmityMembershipQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityCommunityMembershipSearch

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityFeedRepository

Methods
Changes
Remarks

createPost()

Removed

Use equivalent method in AmityPostRepository instead

getPost(postId: String)

Removed

Use equivalent method in AmityPostRepository instead

deletePost(postId: String)

Removed

Use equivalent method in AmityPostRepository instead

reviewPost(postId: String)

Removed

Use equivalent method in AmityPostRepository instead

getReactions(postId: String)

Removed

Use equivalent method in AmityPostRepository instead

getComments(postId: String)

Removed

Use equivalent method in AmityPostRepository instead

AmityPostRepository

Methods
Changes
Remarks

deletePost(postId: String)

softDeletePost(postId: String)

deletePost(postId: String, hardDelete: Boolean)

hardDeletePost(postId: String)

AmityCommunityPostQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityUserPostQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityGlobalFeedQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityCustomRankingGlobalFeedQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityPostReactionQuery

Methods
Changes
Remarks

query()

Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>

getPagingData()

Removed

AmityStreamRepository

Methods
Changes
Remarks

getStream(streamId: String)

Removed

Use observeStream(streamId: String) instead

AmityStreamQuery

Methods
Changes
Remarks

getStream(streamId: String)

Removed

Use observeStream(streamId: String) instead

Model

AmityChannel

Methods
Changes
Remarks

getUnreadCount()

getDefaultSubChannelUnreadCount()

hasUnreadMention()

hasDefaultSubChannelUnreadMention()

AmityMessage

Methods
Changes
Remarks

getChannelSegment()

getSegment()

getChildrenNumber()

getChildCount()

getUser()

getCreator()

getUserId()

getCreatorId()

AmityComment

Methods
Changes
Remarks

getChildrenNumber()

getChildCount()

getUser()

getCreator()

getUserId()

getCreatorId()

AmityCommunity

Methods
Changes
Remarks

getUser()

getCreator()

getUserId()

getCreatorId()

AmityPost

Methods
Changes
Remarks

getUser()

getCreator()

getUserId()

getCreatorId()

AmityStream

Methods
Changes
Remarks

getUser()

getCreator()

Last updated

#3026: New Content: Technical FAQ

Change request updated