isFullon upload, the original size of the image can also be returned.
AmityMessageRepositoryclass. Before calling any messaging methods, you must ensure to first instantiate a repository instance using the
AmityClientinstance you created on setup.
syncStateproperty in the message model.
URLinstance instead. The SDK will resize and process the image object before sending it to the server.
dataproperty in the message model, under the
captionkey. You can add up to 1,000 characters of text caption per message.
fullImageparameter to request to upload the image at its original resolution. Note that this can drastically reduce the speed of message sending, depending on the original image size. If the
fullImageis set to
false, then the uploaded image size will be up to 1500x1500 pixels.
URLinstance of the selected file and file name for the file. The default file name is
file. The SDK will check the size of the data whether it is exceeding the limit or not before sending it to the server. If the size of the data is more than the limit, the callback will return an
Errorobject with the
Dictionaryof the error information that you can parse it and show an error message.
fileNamekey on the message data property, based on the file name that you choose to use. We advised that you handle the file size issues beforehand, as currently our limitation is set to less than 1 GB.
createAudioMessage:a method to send voice clips to other users. It accepts voice clips as a
AmityMessageRepository. It provides
deleteMessage:method to delete message with messageId.
Dictionaryinstance. The server will populate this as a
JSONformat. Later on, you must parse it by yourselves depending on the key and value that you set earlier on.
excludingTagsparameters let you filter messages based on the tags set (or not set) in each message
parentIdparameters let you filter messages by their relationship:
filterByParentIdis set to
false, any message will match.
filterByParentIdis set to
parentIdis passed, query for all messages without a parent.
filterByParentIdis set to
parentIdis passed: query for all messages with the
AmityMessageRepository.You can observe the message with specific
channelId, force the
true, and inject the
parentIdof the message. (See message filtering section)
parentIdto the message creation.
messageId. Since it is a live object remember to observe its changes on top of the token.
tableView:cellForRowAtIndexPath:method. You can download an image using
downloadImageAsData:method from the
AmityFileRepositoryclass. You need to pass the
Stringinstance and the method provides the appropriate image url depending upon the sync state of message.
smallis used for image thumbnails, with a maximum image size of 160 pixels per dimension. For example, this should be used for small previews in an image gallery that displays a large amount of images in a grid.
mediumis used for standard image display, with a maximum image size of 600 pixels per dimension. It's sized to take up about half of a mobile phone's screen size.
largeis used for full screen image display, with a maximum image size of 1500 pixels per dimension.
fullis used to get the original image. This size is only valid if the image is uploaded with the property
YES. If a full sized image is not available, a
largesized image will be returned instead.
downloadFileAsData:method to download the file from URL. The same method can be used to download the audio.
AmityReactionRepository. We can observe in the same way as observing message. The only difference is sending
postIdas the parameter. The operation will return an instance
AmityReactionthat contains reaction name, message id, reactor id and reactor display name of the user and the reaction used.
AmityReactionRepositoryto perform its operation. Initialize the reactor with the client, don't forget to specify the reaction name as well.
AmityReactionRepositoryto perform its operation. Initialize the reactor with the client and specify the reaction name.
AmityMessageEditorclass is also provided for you to perform actions on messages you've sent or received. These actions include editing and deleting an existing message, as well as marking a message as being read by you.
AmityMessageEditorinstance with the
AmityClientinstance you created on setup, as well as a valid
editedAtDatewill be set to the current time. This allows you to provide UI to the user to inform the user of specific messages that have been edited, if needed. An optional completion block can be provided to notify you of operation success.
AmityMessagecontains new properties related to mention feature:
mentionedUsers- an array of
AmityUserobjects. It provides information of mentioned users in the current text message.
metadata- a dictionary which can contain any information about the current message. Our default structure to represent mentions is inside the metadata property. Customers can use any structure to represent mentions.
AmityMessageMentionMetadatais a helper class which can transform metadata into mentions and vice versa. This class uses our custom structure of representing mentions in text messages.
mentionees- an array of
AmityMentioneesmodel represents the following information about mentions in the message:
channel, this array will be empty.
AmityMessageand store mentions in the metadata property. To represent mentions with our own structure, you need to use the
AmityMessageMentionMetadatahelper class and
AmityMessageMentionMetadatahas two class member functions:
AmityMentionmodel array provided by
AmityMentionmodel contains four properties:
AmityMessageMentionType- type of the mention
Integer- start index of current mention
String- userId of the user being mentioned. If the type of the mention is channel, then
Integer- length of the mention
mentioneesobject to Back-end to be able to handle notifications.
AmityMentioneesBuilderclass helps build
mentioneesobject. It has two methods:
mentionChannel()- builds mention with channel
mentionUsers(userIds: [String])- takes an array of userIds and builds mentions with type user and userIds
mentioneesobjects. Send a text message with mentions.
mentionConfigurationsproperty which is the
isMentionAllEnabledproperty which is an indicator whether you can mention the channel or not.
displayName- display name of the member being searched
AmityChannelMembershipFilterBuilderhas this method:
AmityChannelMembershipSearchFiltertype as an argument. Search results are ordered by last created.
AmityChannelMembershipSearchFilteris an enum which has three cases:
member- Standard member
mute- Muted member
ban- Banned member
AmityChannelMemberwhich contains only banned and muted users.
hasMentionproperty is "true" in
AmityChannelclass. Everytime the
hasMentionproperty is true, this means that the member has an unread message with mention(message could be created or updated as well).
bodyTemplateparameters respectively. Here is a sample model: