Android SDK v6.0.0 Migration Guide
This guide is to provide information about breaking changes and how to migrate to the Social Plus SDK 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 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
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
startReading()
Removed
stopReading()
Removed
AmityChannelMembershipQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityChannelMemberSearch
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityMessageRepository
createMessage(channelId: String)
createMessage(subChannelId: String)
getMessages(channelId: String)
getMessages(subChannelId: String)
AmityMessageQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityMessageQuery.Builder
stackFromEnd(stackFromEnd: Boolean)
Removed
Use sortBy(sortOption: AmityMessageQuerySortOption)
instead
AmityMessageReactionQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityCoreClient
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
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
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityMyFollowingsQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityUserFollowersQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityUserFollowingsQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityUserQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityUserSearch
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityUserNotification
setAllowed(isAllowed: Boolean)
Removed
Use enable()
or disable()
instead
isAllowed
Removed
Use getSettings()
instead
AmityUserUpdate
update()
apply()
AmityCommunityCategoryQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityCommentRepository
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
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityCommunityQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityCommunityModeration
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
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityCommunityMembershipSearch
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityFeedRepository
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
deletePost(postId: String)
softDeletePost(postId: String)
deletePost(postId: String, hardDelete: Boolean)
hardDeletePost(postId: String)
AmityCommunityPostQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityUserPostQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityGlobalFeedQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityCustomRankingGlobalFeedQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityPostReactionQuery
query()
Return Flowable<PagingData<X>> instead of Flowable<PagedList<X>>
getPagingData()
Removed
AmityStreamRepository
getStream(streamId: String)
Removed
Use observeStream(streamId: String)
instead
AmityStreamQuery
getStream(streamId: String)
Removed
Use observeStream(streamId: String)
instead
Model
AmityChannel
getUnreadCount()
getDefaultSubChannelUnreadCount()
hasUnreadMention()
hasDefaultSubChannelUnreadMention()
AmityMessage
getChannelSegment()
getSegment()
getChildrenNumber()
getChildCount()
getUser()
getCreator()
getUserId()
getCreatorId()
AmityComment
getChildrenNumber()
getChildCount()
getUser()
getCreator()
getUserId()
getCreatorId()
AmityCommunity
getUser()
getCreator()
getUserId()
getCreatorId()
AmityPost
getUser()
getCreator()
getUserId()
getCreatorId()
AmityStream
getUser()
getCreator()
Last updated