Links

iOS SDK v6.0.0 Migration Guide

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

Installation

Manual Installation

AmitySDK 6.x.x version requires RealmSwift.xcframework along with existing frameworks.

Behaviour Changes

Channel

  • Channel Creation
Support for Providing custom ID when creating channel is now removed.
  • Sub Channels:
Now you can create multiple sub-channels inside a channel. Each Sub Channels acts as a separate container for message. The channel itself would act as a default Sub Channel. You can access this default sub channel id through defaultSubChannelId property in class AmityChannel.

Messages

Sending a message in a Channel or Sub Channel now requires subchannelId. If you want to send message in default subchannel (i.e the default channel itself), please use defaultSubChannelId property from AmityChannel.
For sending message in particular AmitySubchannel, you can get its id from subChannelId property.

Interface Changes:

  • @objc support for all interfaces such as classes, enums, methods, properties are removed. Please create a swift wrapper class to interact with the SDK if your project still uses Objective-C.
Please refer to Using AmitySDK with ObjectiveC section of the documentation for more details.
  • All Enums with rawType UInt has been changed to Int
  • Swift classes
AmityCollection
Property | Methods
Changes
count() UInt
count() → Int
object(atIndex: UInt)
object(at: Int)

AmityReaction

Property | Methods
Changes
createdAtDate
createdAt

AmityClient

Property | Methods
Changes
Remarks
clientErrorDelegate
Removed
Use delegate instead
connectionStatus
Removed
Use sessionState instead
AmityRegionalEndpoint
Removed
Use AmityRegion instead
init(apiKey:, httpUrl:, socketUrl:_)
Removed
Use init(apiKey:_, region: _) instead
init(apiKey:, url:)
Removed
Use init(apiKey_, endpoint:_)
login(userId:, displayName:,authToken:,completion:)
Removed
Use login(userId:,displayName:,authToken:,sessionHandler:) async instead

AmityContentSettings

Property | Methods
Changes
Remarks
chat
Removed
Use message instead

Channel

Property | Methods
Changes
Remarks
totalUnreadCount: UInt
Removed
New property totalDefaultSubChannelUnreadCount: Int is introduced which provides unread count for default subchannel.
AmityChannelBuilderProtocol
Renamed
Use AmityChannelBuilder instead.
class AmityChannelQueryType
enum AmityChannelQueryType
Class is changed to Enum

AmityChannel

Property | Methods
Changes
Remarks
unreadCount
Renamed → defaultSubChannelUnreadCount
hasMention
Renamed → defaultSubChannelHasUnreadMention

AmityChannelParticipation

Property | Methods
Changes
Remarks
startReading()
Removed
Use startReading(subChannelId:) instead
stopReading
Removed
Use stopReading(subChannelId:) instead

AmityMessage

Property | Methods
Changes
Remarks
isMessageEdited
Removed
Use isEdited instead
AmityMessageReactor
Removed
Use AmityReactionRepository instead
createdAtDate
Renamed → createdAt
editedAtDate
Renamed → editedAt
flagCount: UInt
flagCount: Int
reactionsCount: UInt
reactionCount: UInt
readByCount: UInt
readByCount: Int
childrenNumber: UInt
childrenNumber: Int
channelSegment: UInt
channelSegment: Int

AmityMessageRepository

Property | Methods
Changes
Remarks
createCustomMessage(withChannelId:_,...) → String
Removed
Use createCustomMessage(options:, completion:) instead
createTextMessage(withChannelId:_,...) → String
Removed
Use createTextMessage(options:, completion:_) instead
createTextMessage(withChannelId:, …, mentionees:, ..)
Removed
Use createTextMessage(options:, completion:_) instead
createAudioMessage(withChannelId:_,…) → String
Removed
Use createAudioMessage(options:, completion:_) instead
createImageMessage(withChannelId:_,…) → String
Removed
Use createImageMessage(options:, completion:_) instead
createFileMessage(withChannelId:_,…) → String
Removed
Use createFileMessage(options:, completion:_) instead
createVideoMessage(withChannelId:_,…) → String
Removed
Use createVideoMessage(options:, completion:_) instead

AmityMessageEditor

Property | Methods
Changes
Remarks
edittext(_ text: String, completion:....)
Removed
Use edittext(_ text: String, metaData, mentionees, completion:....) instead
edittext(_ text: String, metaData, mentionees, completion:....)
Changed
Parameter metaData and metionees are now nil by default.

AmityPost

Property | Methods
Changes
Remarks
childrenPosts: [AmityPost]?
childrenPosts: [AmityPost]
property is Non-optional
getVideoInfo(for quality: AmityVideoDataQuality)
Removed
Use getVideoInfo() → AmityVideoData?
getVideosInfo()
Removed
Use getVideoInfo() → AmityVideoData?
availableVideoQuality()
Removed
Use availableResolution() → [AmityVideoResolution] instead
commentsCount: UInt
commentsCount: Int
flagCount: UInt
flagCount: Int
reactionsCount: UInt
reactionsCount: Int
sharedCount: UInt
sharedCount: Int

AmityPollRepository

Property | Methods
Changes
Remarks
AmityPollCreateBuilder
Renamed
Use AmityPollCreateOptions
createPoll(_ builder: AmityPollBuilder,:_)
Renamed
Use createPoll(_ options: AmityPollCreateOptions)

AmityPoll

Property | Methods
Changes
voteCount: UInt
voteCount: Int
closedIn: UInt
closedIn: Int

AmityPollAnswer

Property | Methods
Changes
voteCount: UInt
voteCount: Int

AmityPostRepository

Property | Methods
Changes
Remarks
getPostForPostId(_:)
Renamed
getPost(withId:_)
approvePost(withPostId:,:)
Renamed
approvePost(withId:,:)
declinePost(withPostId:,:)
Renamed
declinePost(withId:,:)
deletePost(withPostId:,:)
Renamed
deletePost(withId:,:)
updatePost(withPostId:,:)
Renamed
updatePost(withId:,:)

AmityFeedRepository

Property | Methods
Changes
Remarks
createPost
Removed
Use equivalent method from AmityPostRepository
updatePost
Removed
Use equivalent method from AmityPostRepository
deletePost
Removed
Use equivalent method from AmityPostRepository
approvePost
Removed
Use equivalent method from AmityPostRepository
declinePost
Removed
Use equivalent method from AmityPostRepository
getReactions
Removed
Use equivalent method from AmityPostRepository
getPostForPostId
Removed
Use equivalent method from AmityPostRepository

AmityCommunityRepository

Property | Methods
Changes
Remarks
addRole
Removed
Use addRoles instead
removeRole
Removed
Use removeRoles instead
AmityCommunityCreateDataBuilder
Removed
AmityCommunityCreateOptions
AmityCommunityUpdateDataBuilder
Removed
AmityCommunityCreateOptions
createCommunity(with builder: AmityCommunityBuilder,:_)
Removed
createCommunity(with options: AmityCommunityCreateOptions)
updateCommunity(withId:, builder: AmityCommunityBuilder,:)
Removed
updateCommunity(withId:, options: AmityCommunityUpdateOptions, :)
getCommunities(displayName:,:_)
Removed
Use getCommunities(with options: AmityCommunityQueryOptions)

AmityCommunity

Property | Methods
Changes
postsCount: UInt
postsCount: Int
membersCount: UInt
membersCount: Int

AmityCommentRepository

Property | Methods
Changes
Remarks
getCommentWithReferenceId(_:)
Removed
Use new method getCommments(options: AmityCommentQueryOptions)
createComment(forReferenceId:_,: _)
Removed
Use new method createComment(with options: AmityCommentCreateOptions)

AmityComment

Property | Methods
Changes
Remarks
flagCount: UInt
flagCount: Int
childrenNumber: UInt
childrenNumber: Int
reactionsCount: UInt
reactionsCount: Int

AmityUser

Property | Methods
Changes
flagCount: UInt
flagCount: Int
isGlobalBan
Renamed → isGlobalBanned

AmityUserFollowManager

Property | Methods
Changes
Remarks
getMyFollowInfo(:,completion:)
Removed
Use getMyFollowInfo(_:) → AmityObject which returns Live Object
getUserFollowInfo(:,completion:)
Removed
Use userFollowInfo(_:) → AmityObject which returns Live Object