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

MethodsChangesRemarks

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

MethodsChangesRemarks

startReading()

Removed

stopReading()

Removed

AmityChannelMembershipQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityChannelMemberSearch

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityMessageRepository

MethodsChangesRemarks

createMessage(channelId: String)

createMessage(subChannelId: String)

getMessages(channelId: String)

getMessages(subChannelId: String)

AmityMessageQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityMessageQuery.Builder

MethodsChangesRemarks

stackFromEnd(stackFromEnd: Boolean)

Removed

Use sortBy(sortOption: AmityMessageQuerySortOption) instead

AmityMessageReactionQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityCoreClient

MethodsChangesRemarks

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

MethodsChangesRemarks

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

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityMyFollowingsQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityUserFollowersQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityUserFollowingsQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityUserQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityUserSearch

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityUserNotification

MethodsChangesRemarks

setAllowed(isAllowed: Boolean)

Removed

Use enable() or disable() instead

isAllowed

Removed

Use getSettings() instead

AmityUserUpdate

MethodsChangesRemarks

update()

apply()

AmityCommunityCategoryQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityCommentRepository

MethodsChangesRemarks

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

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityCommunityQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityCommunityModeration

MethodsChangesRemarks

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

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityCommunityMembershipSearch

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityFeedRepository

MethodsChangesRemarks

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

MethodsChangesRemarks

deletePost(postId: String)

softDeletePost(postId: String)

deletePost(postId: String, hardDelete: Boolean)

hardDeletePost(postId: String)

AmityCommunityPostQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityUserPostQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityGlobalFeedQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityCustomRankingGlobalFeedQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityPostReactionQuery

MethodsChangesRemarks

query()

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

getPagingData()

Removed

AmityStreamRepository

MethodsChangesRemarks

getStream(streamId: String)

Removed

Use observeStream(streamId: String) instead

AmityStreamQuery

MethodsChangesRemarks

getStream(streamId: String)

Removed

Use observeStream(streamId: String) instead

Model

AmityChannel

MethodsChangesRemarks

getUnreadCount()

getDefaultSubChannelUnreadCount()

hasUnreadMention()

hasDefaultSubChannelUnreadMention()

AmityMessage

MethodsChangesRemarks

getChannelSegment()

getSegment()

getChildrenNumber()

getChildCount()

getUser()

getCreator()

getUserId()

getCreatorId()

AmityComment

MethodsChangesRemarks

getChildrenNumber()

getChildCount()

getUser()

getCreator()

getUserId()

getCreatorId()

AmityCommunity

MethodsChangesRemarks

getUser()

getCreator()

getUserId()

getCreatorId()

AmityPost

MethodsChangesRemarks

getUser()

getCreator()

getUserId()

getCreatorId()

AmityStream

MethodsChangesRemarks

getUser()

getCreator()

Last updated

#3026: New Content: Technical FAQ

Change request updated