Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Amity SDK provides developers with a powerful set of tools for creating a wide range of post types with support for a broad range of content formats, users can create highly dynamic and engaging posts that help to drive user engagement and increase retention, including:
We provide a method for creating each type of post. To create a post, you must first select the target type. The target type is either a user or a community.
User: If you wish to create a post on someone else's feed, provide their user ID as the targetId and set the target type to the user. If you want to create a post on your own feed, leave the target ID empty.
Community: To make a post on a specific community, set the target type to community and provide the community ID.
Each post can have up to 20,000 characters, and custom posts should not have JSON data that is larger than 100KB.
Prior to creating an image post, it is crucial to upload the images that will be included in the post data to ensure that the necessary information is accessible and can be linked to the post. This requires uploading the image first, to obtain the image data that will be used in creating the image post. To upload an image, please refer to #upload-images.
Upon successful completion of the image upload process, you can include the image data as a parameter when creating an image post, as demonstrated in the code sample below.
Here's an explanation of the method's parameters:
text
: This is a required parameter of type String
, which represents the text content of the new post. You can pass in any text you want to include in the post, up to a maximum length of 20,000 characters.
images
: Which represents an array of images uploaded by the user on Android, iOS and Flutter and imageIds
for Typescript and Javascript to include in the new post. You can pass up to 10 images in a post.
targetType
- Type of the target, either a particular community or a user feed.
tags
- Arbitrary strings that can be used for defining and querying for the posts.
metaData
- Additional properties to support custom fields.
We can build the post first by using AmityImagePostBuilder
. Then use the createImagePost
method in AmityPostRepository
to create image post.
We can build the post first by using AmityImagePostCreator.Builder
. Then use the same createPost
method in AmityPostRepository
to create an image post.
An image post data structure is:
Updating image post in JS SDK is not yet supported.
Version 6
Beta (v0.0.1)
Updating images in image post is not yet supported.
Refer to Post target type for a more detailed explanation of the targetType
parameter.
A post can have a maximum of ten images.
iOS Android Web TypeScript React Native Flutter
Amity Social SDK allows engineers to integrate social communities and user feed capabilities without the hassle of deploying and maintaining any server infrastructure. Companies can now build user-powered social news feeds and notifications into their mobile and web app in no time. Enabling you to engage your customers with the same tools used by many of the popular social applications.
Let users create engaging content and engage with others through comments and reactions. Users can follow other users or topics and become members of various groups to get a personalized timeline of content.
Activity feeds are also a great feature to directly engage with users. You can communicate with your users directly by posting important messages as announcements.
Amity social SDK allows you to:
Connect users through formation of communities
Boost user engagement by user-generated posts/comments in communities
Personalize the feed based on user’s membership to different groups and communities
React to user-generated content with our reaction tools
Enable comments on posts within your application, seamlessly
Support multiple messaging formats when posting content
Manage & moderate communities and users in admin panel
Filter out content that includes profanity using our auto-block tools
Assign roles and permissions on a role-based system
This page will guide you through the steps you need to take to integrate communities into your applications.
Here's an overview of posts and how you can get started with integrating them into your applications.
Here's an overview of how you can get started integrating comments into your applications.
Let users react to messages, posts, and comments, which are visible to others.
Let your users showcase their unique personalities right in their timelines.
Lets you create a relationship between your users in social features.
Prior to creating a live stream post, it is crucial to create the live stream that will be included in the post data to ensure that the necessary information is accessible and can be linked to the post. This requires creating the live stream first, to obtain the data that will be used in creating the live stream post. For more information regarding live stream, please refer to #live-stream
As demonstrated in the code sample below, here's a way to create a live stream.
Upon successful completion of the live stream process, you can include the stream ID as a parameter when creating a live stream post, as demonstrated in the code sample below.
Here's an explanation of the method's parameters:
text
: This is a required parameter of type String
, which represents the text content of the new post. You can pass in any text you want to include in the post, up to a maximum length of 20,000 characters.
streamId
: The ID of the created live stream to include in a post.
targetType
- Type of the target, either a particular community or a user feed.
tags
- Arbitrary strings that can be used for defining and querying for the posts.
metaData
- Additional properties to support custom fields.
You can create a livestream post via AmityLiveStreamPostBuilder
.
AmityLiveStreamPostBuilder
creates a text post and attaches a stream post as a first child. This builder requires the stream object id.
We can build the post first by using AmityLiveStreamPostCreator.Builder
. Then, use the same createPost
method in AmityPostRepository
and pass the streamId
from created AmityStream
to create a livestream post.
Version 6
Beta (v0.0.1)
Here's an overview of posts and how you can get started with integrating them into your applications
A post can be defined as a piece of content created and shared by a user within a network or community. The post can include various types of information such as text, images, videos, links, or other multimedia elements. The SDK provides the necessary tools and functionality for users to create, view, and interact with posts in a social feed. Posts can be displayed in chronological order and can be customized and configured using various settings and options provided by the SDK. The purpose of a post in a product context is to allow users to share information, express thoughts, or connect with others within a social network or community using the SDK.
Amity supports a wide range of post types, each with its own unique set of features and capabilities. The types of posts that you can create in Amity include text, image, video, file, live stream, poll, and custom posts. Furthermore, a post supports real-time events and Live Object features, for more information please refer to Live Objects/Collections and Realtime Events
The post structure is a parent-child relationship, with the parent post serving as a container for text data, for other post types such as images or videos, while each individual image or video is treated as a separate child post. To illustrate this, let's take the example of an image post with two images. In this case, there would be one parent post serving as a text container, and two child posts, each containing one of the images.
In addition to enabling users to create more dynamic and engaging content, both parent and child posts also support reactions and comments. This means that users can interact with not only the parent post but also with each individual child post, providing a more comprehensive and engaging way to engage with content.
The functionality of posts can be utilized through the Post Repository, which offers methods for interacting with a data source that stores posts. This includes methods for obtaining a specific post, creating a new post, updating an existing post, or deleting a post.
Supported ✅ (Please wait while we prepare a real example!)
Prior to creating a file post, it is crucial to upload the files that will be included in the post data to ensure that the necessary information is accessible and can be linked to the post. This requires uploading the file first, to obtain the file data that will be used in creating the file post. To upload a file, please refer to #upload-files
Upon successful completion of the file upload process, you can include the file data as a parameter when creating a file post, as demonstrated in the code sample below.
Here's an explanation of the method's parameters:
text
: This is a required parameter of type String
, which represents the text content of the new post. You can pass in any text you want to include in the post, up to a maximum length of 20,000 characters.
files
: Which represents an array of files uploaded by the user on Android, iOS and Flutter and fileIds
for Typescript and Javascript to include in the new post. You can pass up to 10 files in a post.
targetType
- Type of the target, either a particular community or a user feed.
tags
- Arbitrary strings that can be used for defining and querying for the posts.
metaData
- Additional properties to support custom fields.
We can build the post first by using AmityFilePostBuilder
. Then use the createFilePost
method in AmityPostRepository
to create a file post.
We can build the post first by using AmityFilePostCreator.Builder
. Then use the same createPost
method in AmityPostRepository
to create an image post.
Version 6
Beta
Refer to Post target type for a more detailed explanation of the targetType
parameter.
Updating files in a file post is not yet supported.
Refer to Post target type for a more detailed explanation of the targetType
parameter.
A post can have a maximum of ten files.
Text posts are a simple yet powerful way to create and share text-based content with other users on our platform. With the Amity Social SDK, users can quickly and easily create text posts and add them to a user's or community's feed. As demonstrated in the code sample below, you can simply include the text data as a parameter when creating a text post.
Here's an explanation of the method's parameters:
text
: This is a required parameter of type String
, which represents the text content of the new post. You can pass in any text you want to include in the post, up to a maximum length of 20,000 characters.
targetType
- Type of the target, either a particular community or a user feed.
metaData
- Additional properties to support custom fields.
tags
- Arbitrary strings that can be used for defining and querying for the posts.
Use AmityTextPostBuilder
to create text post.
Version 6
Beta (v0.0.1)
Prior creating a video post, it is crucial to upload the videos that will be included in the post data to ensure that the necessary information is accessible and can be linked to the post. This requires uploading the video first, to obtain the video data that will be used in creating the video post. To upload a video, please refer to #upload-videos
Upon successful completion of the video upload process, you can include the video data as a parameter when creating a video post, as demonstrated in the code sample below.
Here's an explanation of the method's parameters:
text
: This is a required parameter of type String
, which represents the text content of the new post. You can pass in any text you want to include in the post, up to a maximum length of 20,000 characters.
videos
: Which represents an array of videos uploaded by the user on Android, iOS and Flutter and videoIds
for Typescript and Javascript to include in the new post. You can pass up to 10 videos in a post.
targetType
- Type of the target, either a particular community or a user feed.
tags
- Arbitrary strings that can be used for defining and querying for the posts.
metaData
- Additional properties to support custom fields.
Requirements for Video
Supported video types are 3gp
, avi
, f4v
, flv
, m4v
, mov
, mp4
, ogv
, 3g2
, wmv
, vob
, webm
, mkv
The maximum file size of the video is 1 GB
The maximum duration of the video is 2 hours
We can build the post first by using AmityVideoPostBuilder
. Then use the createVideoPost
method in AmityPostRepository
to create a video post.
We can build the post first by using AmityFilePostCreator.Builder
. Then use the same createPost
method in AmityPostRepository
to create an image post.
Version 6
Beta
A post can have a maximum of ten videos.
Uploading HDR video format is not supported on iOS.
If you'd like to display content on your app that cannot be represented by the available text, image, video, and file post types, you can create your own custom post type. Custom post types allow you to include the necessary data for rendering, such as additional metadata and custom data formatting. This is useful if you want to present specific types of content to your users.
To create a custom post type, you can query the user, community, or global feed using our SDK's APIs. Please refer to Feed. For additional information on rendering custom posts with UIKit, please see Post Rendering.
dataType
- a string that defines the type of the post so you can distinguish your new post from others
data
- a free-form JSON object that can be customized based on your use cases.
attachments
- images and other files you want to include in your post. You can only attach one file type. This means that it must either be all images, all files, or all video files.
tags
- text that will be used in post query. You can add up to five tags. Each tag can have a maximum length of 24 characters.
The dataType
parameter should have the custom
prefix.
The functionality isn't currently supported by this SDK.
Please refer to the web API for custom post creation.
Version 6
Beta (v0.0.1)
The functionality isn't currently supported by this SDK.
Please refer to the web API for custom post creation.
In Amity's social SDK, posts with images, files, or videos follow a Parent-Child relationship, where each uploaded image/file is represented as a separate child post. When creating an image/file post, any text that is set will act as the Parent post. The Parent post contains a child posts property, which provides an array of AmityPost instances for each child post. For more information about post structure, please refer to -
Each instance of a Post holds several pieces of information, including data, reactions, comments, metadata, child posts, and more. For text posts, you can access the actual data of the post through the data property. Similarly, for child posts, developers can also access the data through the same data property. Additionally, more details about uploaded files and images can be accessed through the provided functions; such as getFileInfo()
or getImageInfo()
.
To illustrate this concept, consider a post that contains both text and an image. In this case, the parent post would be a text post, and its child post would be an image post. By accessing the child posts property of the parent post, you can easily access and manage the child post information, allowing for a more flexible and efficient approach to managing posts in social applications.
Posting visual content such as photos, graphics, or images is facilitated by this type of post. The maximum size for an image is 1 GB, and the image will be automatically transformed into four different sizes for versatile usage which are:
Small
Medium
Large
Full
Supported ✅ (Please wait while we prepare a real example!)
There are two ways to download the uploaded image.
Using FileRepository
FileRepository
class provides dedicated downloadImage(..)
method to download images uploaded using same class.
Note: This class does not perform any kind of caching for downloaded image. Please refer to header docs for download method for more details.
Using any third party library or your own implementation
You can download the file / image directly from provided fileUrl
using your own implementation or any custom third party libraries of your choice.
Supported ✅ (Please wait while we prepare a real example!)
If you are using your own implementation to download image of appropriate size, you need to construct the download url yourself by appending size
query parameter.
For example, to download a small image:
Value for Size
query parameters can be: small, medium, large, or full.
This is a useful type of post for sharing video content within a feed, such as a short clip or a longer video. The maximum size for a video is 1 GB, and the video will be automatically transcoded into different resolutions for versatile usage which are
1080p
720p
480p
360p
original
Supported ✅ (Please wait while we prepare a real example!)
In Amity's social SDK, there are two types of post deletion: soft delete and hard delete. When a post is soft deleted, it is simply marked as deleted, with the isDeleted
flag set to true
in the database. The post still exists in the database, but is no longer visible to users. By contrast, when a post is hard deleted, all associated data, including reactions, comments, child posts, and related data, is permanently removed from the database. This makes it impossible to retrieve the data once it has been hard deleted.
To perform a hard delete, developers can pass a boolean value of true to the delete post method in the PostRepository. For a soft delete, the boolean value should be false. If no deletion type is specified, the default is soft deletion. By offering these two types of post deletion, Amity's social SDK provides developers with flexibility and control over managing their posts and associated data.
Version 6
Beta (v0.0.1)
Only the owner of the post or an admin can update and/or delete a post.
Hard deletion is only supported via the SDK at this time, and not yet available in the UIKit or Console. To delete a post in Amity's social SDK, developers can use the PostRepository and specify the post ID and the desired deletion type.
Please also note that the file in the post will not be automatically deleted when the post is deleted.
The Social SDK product includes a powerful Posts Query method that allows users to search for and retrieve posts that match specific criteria. This functionality is useful for a variety of use cases and provides a flexible and customizable approach to managing and displaying content in your app. Furthermore, the result of the method will always return as .
Posts Query API can be useful for the use cases that require flattening the search and results. For example:
All posts in a community or user feed
Media gallery that shows the list of all images, posted by a user
List of all the text posts that are deleted in a community
The Posts Query method is capable of retrieving and searching all posts on the server that match the specified criteria, which are:
targetId
- ID of the community or user respectively.
targetType
- Type of the target, either a particular community or a user feed.
types
- available post types are video
, image
, file
, liveStream
, poll
and custom
post. Alternatively, if you don't specify a particular post type, it will return all post types for a specific target.
includeDeleted
- Deletion filter. When the boolean is set to true
, it retrieves both deleted and non-deleted posts. Conversely, when set to false
, only non-deleted posts are returned. The default state of the boolean is false
. Additionally, it excludes all deleted posts (both soft and hard deleted posts) not owned by the logged-in user. Community moderators have visibility of soft-deleted posts in the community feed, while self-users can see their own soft-deleted posts in their user feed.
sortBy
- When it is set to "lastCreated", the most recently created posts will appear at the top of the result. Conversely, when the "sortOption" is set to "firstCreated", the earliest created posts will be displayed at the top of the result.
feedType
- Type of the feed, for possible feedTypes please refer to - .
Version 6
Beta (v0.0.1)
In Flutter SDK, supported query post types are "video
", "image
" and "file
".
For custom post, follow a namespace like format.
Example: "my.customtype
"
The Amity SDK provides a functionality that allows you to work with social features in your application, including the ability to retrieve a post. In this section, we'll explore how to use the Amity SDK to retrieve a single post from your application. By using a specific function provided by the SDK, you can retrieve a post based on its ID, which provides a convenient way to access specific post data. The retrieved result is returned as a live object of a post. For more information on live objects, please refer to .
Version 6
Beta (v0.0.1)
You can use the getPost()
method to get a single post. You need to pass the postId
of the requested post as the parameter.
In order to get live update from any changes or bind with StreamBuilder
widget, you can alternatively use AmityPost.listen
To retrieve multiple posts, you can use getPostByIds
method provided by PostRepository
. This method accepts a collection of postId
as a parameter and returns a ofAmityPost
.
Prior to creating a poll post, it is crucial to create the poll that will be included in the post data to ensure that the necessary information is accessible and can be linked to the post. This requires creating the poll first, to obtain the data that will be used in creating the poll post. For more information about polls including vote, close, or delete a poll, please refer to the page - .
text
: This is a required parameter of type String
, which represents the text content of the new post. You can pass in any text you want to include in the post, up to a maximum length of 20,000 characters.
pollId
: The ID of the created poll to include in a post.
targetType
- Type of the target, either a particular community or a user feed.
tags
- Arbitrary strings that can be used for defining and querying for the posts.
As demonstrated in the code sample below, here's a way to create a poll and poll post.
Version 6
Beta (v0.0.1)
metaData
- Additional properties to support custom fields.
Mentions allow users to tag other users in posts. It's a powerful tool for fostering engagement and collaboration within your social application. With mentions, users can easily notify specific individuals or groups to new content or important updates. In the SDK, mentions can be implemented in a range of ways, depending on your application's needs and user experience. For more information about mentions, please refer to .
You can easily mention users when creating a post by including their user IDs in the mention user parameter as well as defining metadata for mention rendering. For further explanation, please refer to .
Version 6
Beta (v0.0.1)
In this example, we show a text post with mention. However the pattern of adding mention to a post; is the same for all post types. You can apply the same creation process to the desired post type.
We provide developers with an efficient method for updating posts with mentions of specific users, you can easily add mentions to their post updates and but it will not notify the relevant users.
To remove mentions you can provide an empty JSON object for the metadata parameter, and an empty list for the mention users parameter. By doing so, You can easily remove mentions from the post content, while ensuring that the overall structure of the post remains intact.
When updating a text or video post with mentions, you can provide the JsonObject
for the metadata
parameter and provide the list of userId
for the mentionUsers
parameter.
Supported ✅ (Please wait while we prepare a real example!)
Version 6
Beta (v0.0.1)
The SDK provides a way for users to report or flag a post as inappropriate using the flag
method.
This method allows users to notify the community moderators or admins about posts that they believe violate the community guidelines or are otherwise inappropriate. By flagging a post, users can help ensure that the community remains a safe and welcoming place for all members.
This method allows users to quickly determine whether they have previously flagged a post as inappropriate or not. To use this method, users can call the isFlaggedByMe
method with the postId
as a parameter. The method will then return a boolean value indicating whether or not the post has been flagged by the current user.
This method allows users to retract their earlier report if they believe that the flagged post no longer violates the community guidelines or if they mistakenly reported the post. By unflagging a post, users can help ensure that the community moderators or admins can focus their attention on other reported posts that may still require attention.
Editing and changing post details and content
Amity SDK supports the editing of the following post types:
Text post
Image post
File post
Video post
Amity Social SDK provides a post editing functionality that fosters accountability and user awareness within your application. This feature enables users to edit their own posts exclusively. Users can only edit their own posts, except that you're an admin or a moderator of a particular community. The functionality encourages responsible interactions and maintains accountability. Upon completing an edit operation, the SDK updates the editedAt
property to the current time, reflecting the changes made by the user. You can then leverage the updated editedAt
timestamp to create a user interface that informs users of edited posts, fostering transparency. You can edit a post by follow this sample code.
You can edit a post using a pattern similar to creating a post. Follow these steps:
Choose the appropriate post builder type and structure your post.
Make the API call for post editing.
Note: If you intend to update files, images, or videos in a post, you must upload them first. Once you have the data, you can use it with the corresponding post type. Ensure that the builder type matches the original post type.
For further details on uploading, refer to .
To edit a text post, utilize the editPost
method in a post repository using AmityTextPostBuilder
class to compose a new text as demonstrated in the provided code snippet.
To edit a file post, utilize the editPost
method in a post repository using AmityFilePostBuilder
class to compose a set of new files as demonstrated in the provided code snippet. The files
parameter should include both the current files (if required) and any newly uploaded files you wish to append to the post.
To edit an image post, utilize the editPost
method in a post repository using AmityImagePostBuilder
class to compose a set of new images as demonstrated in the provided code snippet. The images
parameter should include both the current images (if required) and any newly uploaded images you wish to append to the post.
To edit a video post, utilize the editPost
method in a post repository using AmityVideoPostBuilder
class to compose a set of new videos as demonstrated in the provided code snippet. The videos
parameter should include both the current videos (if required) and any newly uploaded videos you wish to append to the post.
If you want to edit a file/image/video post to add more files, the files/images to be added must be uploaded first. The AmityFileRepository
class handles the uploading and downloading of files. The repository has an uploadFile
method which takes the file's Uri
and returns an array of AmityUploadResult
for successful or failed uploads.
AmityUploadResult
will return four possible types of data:
AmityUploadResult.PROGRESS
- uploading is in progress. It returns AmityUploadInfo
which can be used to track the progress of the upload.
AmityUploadResult.COMPLETE
- the upload completed successfully. It returns AmityFile
that can then be attached to the post.
AmityUploadResult.ERROR(exception)
- the upload failed. It returns an Exception
.
AmityUploadResult.CANCELLED
- uploading is canceled.
To edit a file post, use the edit
method as shown in the sample code below. The attachments
should contain the uploaded files that you want to add to the post which are stored in existingFiles
and newFiles
respectively.
To edit an image post, use the edit
method as shown in the sample code below. The attachments
should contain the existing images and the uploaded images that you want to add to the post which are stored in existingImages
and newImages
respectively.
You can remove existing images from the post by excluding them from the attachments
list. You can also change the order of the images in the list.
To edit a video post, use the edit
method as shown in the sample code below. The attachments
should contain the existing videos and the uploaded videos that you want to add to the post which are stored in existingVideos
and newVideos
respectively.
This method requires the following parameters:
postId (String)
- ID of the post to update
data (Object)
- data object of the post
Other optional parameters are:
metadata (Object)
- the metadata object of the post
tags (Array.<String>)
- strings used to query the post. Up to five tags can be added and each tag can be up to 24 characters long.
In JavaScript SDK, the following are not yet supported:
Adding videos to a non-video post (e.g. text post, image post)
Adding different media types (e.g. image, custom files) in a single post
The updatePost
method returns a Promise<boolean>
- true
if the post is successfully updated. Otherwise, it will throw an error.
You can add new videos or remove existing ones from a video post. In adding new videos, you must first upload the videos that you will add to the post. Refer to Upload Video for the details on how to upload a video.
When updating a video post, provide the file ID of the video and the type FileType.Video
in the attachments
parameter. Modifying attachments
array will overwrite the existing videos so it’s recommended to include original attachments if you want to retain the original videos in the post. Leave the attachments
array empty to remove all videos.
Version 6
Beta (v0.0.1)
When updating a post, you can update its text content. However, you cannot add or remove the post's attachments (i.e. image, video, and file).
You can update the post using the update
method. This method requires the following parameters:
postId (String)
- ID of the post to update
text (String)
- text data of the post
You can upload a maximum of ten images/files in a single post.
This allows for flexible usage and easy integration into various social applications. For more information about an image, please refer to the page - .
provided URL:
with size query parameter:
This is a post that contains a file attachment, such as a PDF, a Word document, or any other type of file. This is a useful type of post for sharing files within a channel, such as a document or a photo. The maximum size for a file is 1 GB. For more information about a video file, please refer to the page -
Once you uploaded a video the videos undergo transcoding from their original resolution. You can quickly access the original size of the video right after you make the video post. However, it takes time for the transcoded resolutions to be ready. This allows for flexible usage and easy integration into various social application. For more information about a video file, please refer to the page - .
Live stream posts offer an effective means of creating captivating and interactive content that engages users and promotes deeper connections among them. The Amity Social SDK enables developers to swiftly integrate live stream posts into a social feed, allowing them to share their real-time experiences with other users on the platform. For more information about live stream, please refer to the page - .
To implement poll functionality in posts, developers can leverage the existing poll features in Amity SDK and integrate them into posts. Polls can be created as child posts within the post thread, with the poll data and options easily accessible to users. Users can then participate in the poll by selecting their preferred option, and the results can be displayed in posts. For more information about live stream, please refer to the page - .
To render mentions in a supported feature, please refer to , specifically the section on handling mentions. This documentation provides detailed information on how to represent mentions in your application, including information on metadata structure, custom mention objects, and rendering support.
For further details on uploading, refer to .
Name
Data Type
Description
postId
String
ID of the post
parentPostId
String
ID of the parent post, this can be null if the post is a parent post.
postedUserId
String
ID of the user who posted
sharedUserId
String
ID of the user who shared the post
SharedCount
Integer
Number of times the post is shared
targetID
String
ID of the target
targetType
String
Type of target
dataType
String
Data type of post
data
Object
Data of the post
metadata
Object
Metadata of the post
flagCount
Integer
Number of times that the post is flagged
editedAt
Date
Date/time the post was edited
createdAt
Date
Date/time the post was created
updatedAt
Date
Date/time the post was updated
reactions
Object
Information about the post reactions
reactionsCount
Integer
Number of reactions to the post
myReactions
Array<String>
Reactions to the post
commentsCount
Integer
Number of comments to the post
comments
Array<AmityComment>
The first three comments of the post for previewing purpose
childrenPosts
Object
Children posts
isDeleted
Boolean
Flag that indicates if the post is deleted. True means post is already deleted.
hasFlaggedComment
Boolean
Flag that indicates if the post has flagged comments. True means it has.
hasFlaggedChildren
Boolean
Flag that indicates if the post has flagged children. True means it has.
tags
Array<String>
Arbitrary strings that can be used for defining and querying for the posts in community and user feeds.
feedId
String
ID of the post's feed
The 'getActiveStories()
' function within the AmitySDK enables users to query non-expired stories based on a specified target, providing a LiveCollection of stories for seamless playback and browsing. Notably, the AmitySDK supports optimistic story creation, including unsynced stories within the collection. In sorting, priority is accorded to unsynced stories followed by synced ones, with secondary sorting based on the 'sortOption.' It is important to note that real-time exclusion of expired stories from LiveCollection is not supported.
This function requires two parameters: targetType, targetId.
Here's an explanation of the function parameters:
targetType
: Represents the type of target, currently supporting 'community.'
targetId
: Corresponds to the ID of the designated target.
sortOption
: Specifies the secondary sorting order for stories within the collection as 'firstCreated' or 'LastCreated.' The default value is 'firstCreated,' organizing stories chronologically based on creation time.
To provide better control and moderation over community posts, the Amity SDK includes a feature that allows community owners to review and approve posts before they appear on the community's feed. This feature allows for a more streamlined and organized approach to managing community content. With Post Review enabled, any post created within a community will first be placed in a Reviewing feed. After approval, it will be moved to the Published feed, while declined posts will be moved to the Declined feed.
reviewing
- when a post is created in a community with Post Review enabled, it is initially placed in the Reviewing feed.
published
- If a post is approved by a moderator or creator, it is moved to the Published feed.
declined
- If a post is declined by a moderator or creator, it is moved to the Declined feed.
Supported ✅ (Please wait while we prepare a real example!)
The AmityPost
object within the Amity SDK provides a method that allows users to retrieve the feed type of a post by calling post.getFeedType()
. This method enables developers to easily determine the current feed that a post belongs to. Understanding the feed type of a post is important for implementing moderation features, as different feeds have different access and permission levels.
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
Within the Amity SDK, there are methods available to moderators and creators of a community that allows them to approve or decline posts.
By calling the method, the selected post will be approved and will appear on the community's feed.
Version 6
Beta (v0.0.1)
By calling the method, the selected post will be declined and will disappear from the community's reviewing feed.
Version 6
Beta (v0.0.1)
To retrieve a list of posts from the Reviewing feed, users with the AmityPermission.REVIEW_COMMUNITY_POST
can retrieve all posts, while users without this permission can only retrieve their own reviewing posts. Users without moderation permissions will receive only posts they created for the Reviewing and Declined feeds.
Here's an overview of stories and how you can get started with integrating them into your application
Stories, unlike traditional posts, excel in sharing time-sensitive updates like promotions or event highlights. The SDK provides tools for creating, viewing, and interacting with diverse story content—images, videos, links—allowing configurable content duration and expiry periods. Additionally, our dashboard offers insights through basic analytics such as views, unique users, comments, reactions, and Click-Through Rate (CTR).
A Story is multi-layered. The primary content, "Data," depending on the dataType, can be either an IMAGE or a VIDEO. The secondary content, "StoryItems," complements the main content, serving as additional components. For instance, the first supported StoryItem is a Hyperlink, containing URL information and its alias. Overlaying the main content allows users to click and be redirected to the predefined destination.
The functionality of stories can be utilized through the StoryRepository
, which offers methods for interacting with a data source that stores stories. This includes methods for obtaining stories, creating a new story, and deleting a story.
The Post Impression feature in our Amity Social Cloud SDK is a tool designed to collect valuable data regarding post interactions for analytics and reporting purposes. This feature empowers users to gain insights into how their content is performing and who is actively engaging with it. With this feature, users can mark specific posts as viewed and access information about impressions, reach, and the list of users who have viewed each post.
Impressions represent the number of users who viewed the post, while reach represents the number of unique users who viewed the post. Please keep in mind that post impression data won't be updated in real-time but rather almost in real-time.
The SDK provides an ability to mark any post as viewed by invoking markAsViewed()
method within post.analytics
, which will increase the impression and reach count of specific posts. Additionally, users can easily access the impression
and reach
counts directly from the post
object within the SDK.
The SDK provides an ability to query a list of unique users who have viewed the specific post. This functionality is available through invoking getViewedUsers(postId)
within the UserRepository
and will return the live collection of user objects.
There are two types of story deletion: soft delete and hard delete. When a story is soft deleted, it is simply marked as deleted, with the isDeleted flag set to true in the database. The story still exists in the database, but is no longer visible to users. By contrast, when a story is hard deleted, all associated data, including reactions, comments is permanently removed from the database. This makes it impossible to retrieve the data once it has been hard deleted. Note that both soft delete and hard delete permanently remove unsynced stories from cache.
The 'softDeleteStory()
' function allows users to mark a story as deleted on the server, rendering it inaccessible to users.
This function requires one parameter: 'storyId.' Here's an explanation of the function parameter:
storyId
: Corresponds to the ID of the story.
The 'hardDeleteStory()
' function permanently deletes the story and all associated data, including reactions and comments from the server.
This function requires one parameter: 'storyId.' Here's an explanation of the function parameter:
storyId
: Corresponds to the ID of the story.
The SDK offers developers a suite of functions to craft stories available in two distinct types: Image and Video.
Image: An Image story facilitates the use of an image file of up to 1GB,
Video: A video story accommodates video files sized up to 2GB with a maximum duration of 90 seconds. The duration setting is adjustable at the network level, providing flexibility in configuration.
Each story creation offers optional StoryItems. The first supported item type, HyperLink, enables inclusion of a URL and an alias, augmenting the story with additional content for user interaction. This feature allows seamless navigation to specified destinations upon story viewing. It's important to note that the provided URL undergoes validation by the system against a predefined whitelist, configurable at the network level.
To initiate story creation, the first step involves selecting the target type. Currently, the supported targetType is 'community,' necessitating the specification of a communityId for story creation within a specific community.
The SDK provides the 'createImageStory()
' function, allowing users to create a story with an image on the specified target.
This function requires three parameters: targetType, targetId, and imageFile.
Here's an explanation of the function parameters:
targetType
: Represents the type of target, currently supporting 'community.'
targetId
: Corresponds to the ID of the designated target.
imageFile
: Denotes the image file intended to be attached to the story.
storyItems
: Additional information that can accompany the story, currently supporting a URL and its alias.
imageDisplayMode
: Dictates how the image should be displayed on the user interface. Either FIT or FILL.
metadata
: Provides support for additional properties, facilitating the use of custom fields.
The SDK provides the 'createVideoStory()
' function, allowing users to create a story with a video on the specified target.
This function requires three parameters: targetType, targetId, and videoFile.
Here's an explanation of the function parameters:
targetType
: Represents the type of target, currently supporting 'community.'
targetId
: Corresponds to the ID of the designated target.
videoFile
: Denotes the video file intended to be attached to the story.
storyItems
: Additional information that can accompany the story, currently supporting a URL and its alias.
metadata
: Provides support for additional properties, facilitating the use of custom fields.
The Story Impression feature is a tool designed to collect valuable data regarding story interactions for analytics and reporting purposes. This feature empowers users to gain insights into how their content is performing and who is actively engaging with it. With this feature, users can mark specific stories as seen and access information about impressions, reach, and the list of users who have viewed each story.
Impressions represent the number of users who viewed the story, while reach represents the number of unique users who viewed the story. Please keep in mind that story impression data won't be updated in real-time but rather almost in real-time.
The 'markAsSeen()
' function in the AmitySDK serves to increase the impression and reach count of specific stories while promptly updating the 'isSeen' state of the story.
Info: In order to mark a story as seen, that story must be in sync state "SYNCED".
Amity Social SDK offers the AmityComment data type, which supports two types of content: TEXT
and IMAGE
. Users can view comments that include text, images, or a combination of both, providing a more versatile and engaging experience for your app's users.
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
The ability to query comments and their replies is essential for creating a robust and user-friendly commenting experience. By using the getComments()
method and passing in the appropriate parameters, you can retrieve the comments and replies that are most relevant to your users.
Comment Replies
The query returns a LiveCollection of all matching comments available. To retrieve replies to a specific comment, you can pass the commentId
as the parentId
. If you want to retrieve parent-level comments, pass parentId = null
. If you omit the parentId
, you'll receive all comments on all levels.
Deletion Filter
You can also use the includeDeleted()
method to query for deleted comments and their replies. By passing true
or false
to this method, you can include or exclude deleted comments from the results.
Note that if you use the includeDeleted()
method, you don't need to check the isDeleted()
method in the AmityComment
object for deleted comments.
To query for image comments only, you can use the dataTypes
parameter and pass the value TEXT
, IMAGE
, or both. There are two options for the dataTypes
parameter: any
and exact
.
any
- When you use the any
option, the retrieved comments will include any comment that contains at least one of the specified data types. For example, if you pass [image, text]
, the retrieved comments may contain only image content, only text content, or both image and text content.
exact
- On the other hand, when you use the exact
option, the retrieved comments will include only comments that contain all of the specified data types. For example, if you pass [image, text]
, the retrieved comments must contain both image and text content. If you pass [image]
, the retrieved comments must contain only image content.
Using exact filer parameter:
Using any filter parameter:
The functionality isn't currently supported by this SDK.
Version 6
Beta(v0.0.1)
The functionality isn't currently supported by this SDK.
The 'getStoryTarget()
' function in the AmitySDK enables real-time observation of StoryTarget based on specified target. This function returns a LiveObject of StoryTarget, enabling users to receive updates and check whether the target possesses unseen stories.
This function requires two parameters: targetType, targetId.
Here's an explanation of the function parameters:
targetType
: Represents the type of target, currently supporting 'community.'
targetId
: Corresponds to the ID of the designated target.
The Amity SDK provides a functionality that allows you to work with social features in your application, including the ability to retrieve a comment. In this section, we'll explore how to use the Amity SDK to retrieve a single comment from your application. By using a specific function provided by the SDK, you can retrieve a comment based on its ID, which provides a convenient way to access specific comment data. The retrieved result is returned as a live object of a comment. For more information on live objects, please refer to .
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
To retrieve multiple comments, you can use getCommentByIds
method provided by CommentRepository
. This method accepts a collection of commentId
as a parameter and returns a ofAmityComment
.
The functionality isn't currently supported by this SDK.
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
Here's an overview of how you can get started integrating comments into your applications
Comment refers to a user-generated response or reaction to a specific piece of content, such as a post or a content. Comments enable users to engage in conversations and express their thoughts, opinions, and emotions about the content they see. They provide a way for users to interact with each other and create a sense of community around the content. Commenting is an essential feature for social platforms as it encourages user engagement, helps create a more immersive experience for users, and can be used to generate insights into user behavior and preferences. In a social SDK product, the SDK provides the necessary tools and functionality for developers to integrate commenting into their apps or websites.
Furthermore, a comment supports real-time events and Live Object features, for more information please refer to and .
Incorporating comment reference types within your app enhances user engagement and promotes interaction, as it allows users to comment on both regular posts and content-specific posts. By differentiating between these two comment types, your app can provide a more organized and contextual commenting experience, catering to the diverse needs of your users and the content they interact with. Comment's referenceType
can be:
post type comment: A post type comment is designed for regular posts, such as text updates, photos, or videos shared by users. These comments are associated with the regular post and are displayed beneath it, facilitating conversation and interaction.
Content type comment: A content type comment, on the other hand, is intended for content-specific posts, such as articles, or other specialized content.
The functionality of comments can be utilized through the Comment Repository, which offers methods for interacting with a data source that stores posts. This includes methods for querying comments, creating a new comment, updating an existing comment, or deleting a comment.
The functionality isn't currently supported by this SDK.
Here's an overview of how you can start integrating comments into your applications
Amity Social SDK's comment creation is designed to handle comments in a fast and reliable way throughout your application. Each comment is given a unique commentId that cannot be changed, and the SDK includes an optimistic update feature. To work with comments, you'll need to use the CommentRepository.
With the SDK's optimistic creation feature for comments, you don't need to create a unique commentId yourself. Instead, the SDK generates one automatically for you. However, you'll need to provide a referenceId and referenceType. This feature allows the app to display the comment optimistically, assuming that it will be added successfully. This improves the user experience by reducing perceived latency.
A comment should not exceed 20,000 characters in length.
The AmityNotificationToken
returned by the observeOnceWithBlock:
is saved in self.token
, a strongly referenced property. This is needed in order to prevent the observe block to be released.
The parentId
parameter in createComment:
is optional.
The referenceId
parameter in createComment:
is mandatory and will only support AmityPost
identifier.
Version 6
Beta (v0.0.1)
Amity Social SDK also allows you to create comments with images. When creating a comment with images, you can use the SDK's optimistic creation feature just like with text comments. The SDK will automatically generate a unique commentId for the image comment. However, in addition to the referenceId and referenceType, you'll also need to provide the image data in the form of fileId
.
The functionality isn't currently supported by this SDK.
Version 6
Beta (v0.0.1)
The functionality isn't currently supported by this SDK.
In addition to creating top-level comments, Amity Social SDK also allows you to reply to existing comments. To reply to a comment, you'll need to specify the parent comment's commentId
as one of the parameters. This allows the SDK to associate the new comment as a reply to the parent comment.
Similar to creating a top-level comment, you can use the SDK's optimistic creation feature to create a reply comment. You don't need to provide a unique commentId
for the reply comment, as the SDK generates one automatically. Instead, you'll need to provide the parentId
, referenceId
, referenceType
, and the text content of the reply.
Supported ✅ (please wait while we prepare a real example!)
Version 6
Beta (v0.0.1)
The functionality isn't currently supported by this SDK.
Version 6
Beta (v0.0.1)
The functionality isn't currently supported by this SDK.
The myReactions
property allows users to retrieve a list of all reactions they have made on a particular comment. This feature makes it easy for users to keep track of their own reactions and to see how their engagement with the post has evolved over time.
The reactions
property, on the other hand, provides a list of all reactions made on the post. This includes reactions made by other users, providing a broader perspective on the post's overall engagement and sentiment.
Finally, the reactionsCount
property provides a simple way to get the total count of reactions on a comment. By using this property, users can quickly see how popular a post is and how engaged the community is with the content.
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
The SDK provides functionality for soft and hard deleting comments. Soft delete marks the comment as deleted while still keeping it in the system with the isDeleted
flag set to true. On the other hand, hard delete completely removes the comment data, including its reactions and replies, from the system.
The need for soft and hard delete functions arises when users want to manage the comments on their app. Soft delete is helpful in situations where the comment has been flagged and needs to be hidden from users without actually deleting the comment. Hard delete, on the other hand, is useful in cases where the comment content is inappropriate and must be permanently deleted from the app.
To hard delete a comment, you can use the AmityCommentRepository, which provides a deleteComment method. When using this method, you need to pass the commentId
and a boolean hardDelete
parameter. Set the boolean parameter to true for hard delete and false for soft delete. If you do not specify the boolean parameter, it will be set to false by default, equivalent to a soft delete. It's important to note that hard deleting children comments will not delete the parent comment.
It's worth mentioning that hard deleting posts and comments is only supported via SDK, with UIKit and Console support potentially being added in the future. By implementing the soft and hard delete features provided by Social SDK, you can give your app's users more control over the comments they interact with while maintaining a safe and appropriate community.
If you will not specify the boolean parameter, it will be set to false
by default which is just equivalent to a soft delete.
The deleteComment
method returns a promise acknowledging the server's successful response. Use await
to receive the result. It will return true
if the deletion is successful. Otherwise, it will return false
.
Version 6
Beta (v0.0.1)
Only the owner of the comment or an admin can update and/or delete a comment.
The Social SDK product also includes a flag method that allows users to flag comments in their app. Once a comment is flagged, an indicator will appear in the Admin console, where an administrator can review and validate the flag. If the content is found to be in violation of your app's policies, it can be deleted from the app. On the other hand, if the content is not found to be in violation, the flag can be revoked.
The flag method provides an essential tool for managing user-generated content in your app, ensuring that inappropriate comments can be quickly identified and removed. By integrating this method into your app's user interface, you can empower your users to take an active role in promoting a safe and respectful community.
Beta (v0.0.1)
Another useful feature is the unflag method, which enables users to revoke a previously flagged comment. If a user flags a comment by mistake or if the comment is found not to violate your app's policies after review, the unflag method can be used to remove the flag from the comment. It ensures that users have control over the content they flag and the ability to reverse their flag if necessary.
Beta (v0.0.1)
The isFlaggedByMe
method allows users to check whether they have previously flagged a particular comment. This method provides a convenient way for users to keep track of the content they have flagged and to ensure that they are staying up-to-date with their moderation activities.
By using the isFlaggedByMe method, your app's users can quickly determine whether they have already flagged a particular comment and avoid duplicating their efforts.
Beta (v0.0.1)
Mentions allow users to tag other users in comments. It's a powerful tool for fostering engagement and collaboration within your social application. With mentions, users can easily notify specific individuals or groups to new content or important updates. In the SDK, mentions can be implemented in a range of ways, depending on your application's needs and user experience. For more information about mentions, please refer to .
You can easily mention users when creating a comment by including their user IDs in the mention user parameter as well as defining metadata for mention rendering. For further explanation, please refer to .
Version 6
Beta (v0.0.1)
We provide developers with an efficient method for updating comments with mentions of specific users, you can easily add mentions to their post updates and but it will not notify the relevant users.
To remove mentions you can provide an empty JSON object for the metadata parameter, and an empty list for the mention users parameter. By doing so, You can easily remove mentions from the post content, while ensuring that the overall structure of the post remains intact.:
To update a comment/reply with mentions, this is the method in AmityCommentEditor
:
Version 6
Beta (v0.0.1)
Refer to for a more detailed explanation of the referenceType
parameter.
Refer to the following on the use of images in comments.
To create a comment with images, you will need to upload an image using function and proving fileId
s in attachments
parameter. The SDK will then handle the rest and create the comment with the image optimistically.
For more details on Reactions, refer to our documentation.
To render mentions in a supported feature, please refer to , specifically the section on handling mentions. This documentation provides detailed information on how to represent mentions in your application, including information on metadata structure, custom mention objects, and rendering support.
Name
Data Type
Description
storyId
String
ID of the story
targetType
Enum
Type of target. COMMUNITY
targetId
String
ID of the target
dataType
Enum
Type of the story. Either IMAGE or VIDEO.
data
Object
Data of the story based on dataType
metadata
Object
Metadata of the story
storyItems
Array<StoryItem>
StoryItems of the story
syncState
Enum
Sync state of the story. [FAILED | SYNCING | SYNCED]
isDeleted
Boolean
Flag indicates whether the story is deleted.
isSeen
Boolean
Flag indicates whether the story has been viewed by the user
myReactions
Array<String>
My reactions on the story
reactionsCount
Integer
Count of reactions on the story
commentsCount
Integer
Count of comments on the story
reactions
Map<String, Integer>
Map containing a key | value of reaction | reactionsCount. For ex., “like” | 20
reach
Integer
Count of reach of the story
impression
Integer
Count of impression of the story
creatorId
String
ID of the user who created the story
expiresAt
DateTime
Date/time the story expires
createdAt
DateTime
Date/time the story was created
Name
Data Type
Description
targetType
Enum
Type of target
targetId
String
ID of target
updatedAt
DateTime
Date/time the story target was updated
hasUnseen
Boolean
Flag indicates whether the StoryTarget possesses unseen stories.
Name | Data Type | Description |
|
| ID of the comment |
|
| ID of the user who posted the comment |
|
| ID of a parent comment |
|
| ID of a reference |
|
| Type of a reference |
|
| Type of the comment |
|
| Body of the comment |
|
| Additional properties to support custom fields |
|
| Number of children comments |
|
| Number of users who has read the comment |
|
| Mapping of reaction with reactionCounter |
|
| Number of all reactions for the comment |
|
| List of my reactions to the comment |
|
| Flag that determines if comment is deleted |
|
| Date/time when comment was edited |
|
| Date/time when comment was created |
|
| Date/time when comment was updated or deleted |
|
| Children comments |
|
| Flag for checking internally if this comment is reported or not |
|
| User IDs of the mentioned users |
In our previous implementation of our global feed, we rank posts in chronological order. This means that newer posts will rank higher than older ones, thus, the former will show up higher in the feed. While this is not a bad algorithm, other factors should also be considered to determine the posts’ ranking in the global feed.
With our new custom post ranking algorithm, we are using a smarter ranking in our global feed that supports a score-sorting mechanism. We focus on what we consider as “meaningful interactions”. This means that, aside from the post’s submission time, we also factor in user engagements, i.e., posts with more comments and reactions will have a higher ranking. In addition, we factor in the updates and edits done to the post.
The post will be ranked according to these factors:
Engagement rate Posts with more comments and reactions will show up higher than posts with less
Time of posting Newer posts will show up higher than older posts. Time decay is applied where the score will decrease as the post gets older.
Updates Post updates and edits on a post will give the post a score boost. Updates may also include new comments and reactions.
Posts will be ranked using mathematical formulas with the following properties in the post model as variables:
commentsCount
- number of comments to the post
reactionsCount
- number of reactions to the post
createdAt
- date/time the post was created
updatedAt
- date/time the post was updated
editedAt
- date/time the post was edited
High engagement rate has a big impact on the ranking. A comment will score twice as much as a reaction. A post’s score will decrease as time goes by. However, updating or editing the post bumps up the score.
The score of each post is calculated for every query. This means that when users want to go to the next page, the score will be recalculated.
If you want to configure the ranking logic to include more factors such as post type, post creator, etc., you may contact Amity Social Cloud Support to review the ranking logic and apply it to the code accordingly.
In our next implementation phase, we will add ranking configurations in ASC Console so users can update ranking logic without the need to call support.
Please note however that our custom post ranking implementation has some limitations currently such as:
While your newly created posts will be immediately available in your User Feed, due to the nature of the ranking algorithm, there may be a momentary delay before it appears on the Global Feed.
Updating the ranking formula can't be done via ASC console. Please contact Amity Social Cloud Support for the formula validation and applying your ranking logic to the network.
You can only see up to 20 posts from each user or community that you are following in the global feed.
Old post data will not be migrated, thus, only the posts that are posted using version 5.10 will show in the global feed.
For more information on how to implement custom post ranking in your global feed, see our documentation here.
We also provide UI Kit guides for custom post ranking for iOS and Android.
The SDK provides two ways for users to retrieve their global feed: the getGlobalFeed
method and the getCustomPostRanking
method. By providing these two distinct ways to retrieve the global feed, the SDK enables users to customize their content experience to better reflect their interests and preferences. This can help to foster a more dynamic and engaging community experience, promoting greater engagement and participation among users.
We provide a simple way to query posts on Global Feed using the getGlobalFeed
method. When using this method, posts will be returned in chronological order by default, allowing users to quickly and easily view the most recent content.
Version 6
Beta (v0.0.1)
Query custom post ranking is a smarter global feed that supports the score-sorting mechanism. The score-sorting mechanism ensures that the posts are presented in order of relevance, with the most engaging and relevant content at the top of the feed. Refer toCustom Post Ranking for more information about this feature. You can use getCustomRankingGlobalFeed
to retrieve posts from this functionality.
You can retrieve your global feed by calling the queryAllPosts
method. This method accepts the following parameters:
The method will return a LiveCollection instance of post model.
The queryAllPosts method
will throw an error if parameters passed are incorrect.
Version 6
Beta (v0.0.1)
Supported ✅ (Please wait while we prepare a real example!)
Users can retrieve information about the community, such as the community name, description, and member count, without actually becoming a member of the community. This provides a way for users to explore their community options and find the communities that are most relevant and engaging to them.
To fetch a community's data without joining, users can simply call the getCommunity
method within the SDK and provide the relevant parameter, such as the community ID. The retrieved result is returned as a live object of a post. For more information on live objects, please refer to Live Objects/Collections.
Version 6
Beta(v0.0.1)
In order to get live update from any changes or bind with StreamBuilder
widget, you can alternatively use AmityCommunity.listen
Our SDK provides a convenient way to create a new community on our platform, with several parameters available to customize the community.
displayName
- allows users to set the public display name of the community, which will be visible to other users who can access the community.
description
- allows users to provide a description of the community, which can help other users understand the purpose and focus of the community.
isPublic
- is used to specify the type of the community. Setting it to false
will create a private community, while setting it to true
will create a public community.
postSettings
- allows users to customize the community post settings. This parameter can be used to configure how posts are moderated within the community, depending on the specific needs and preferences of the community creator.
storySettings
- allows users to customize the community story settings. This parameter can be used to configure whether to enable comment interaction on stories.
metaData
- allows users to include additional properties to support custom fields within the community. This can be useful for creating communities with specific requirements or features that are not available by default in our platform.
Version 6
Beta (v0.0.1)
The Social SDK product also provides functionality for adding and removing reactions on posts. Users can add any number of reactions to a particular post, allowing them to engage with the content in a more expressive and nuanced way. Additionally, users can also remove reactions that they have added to a post, providing greater control and flexibility over their engagement with the content.
The addReaction
function allows users to add a reaction to a post. The function takes the name of the reaction as a parameter, with a maximum length of 100 characters. The reaction name is case-sensitive, which means that "like" and "Like" are treated as two different reactions.
You can add reactions to a given reference through the addReaction
method.
referenceId
- ID of the post or comment respectively.
reactionName
- name of the reaction that you will remove. Reaction name is case sensitive, i.e "like" & "Like" are two different reactions.
The method returns a promise. If the reaction is successfully removed, the method will return true
. Otherwise, it will return false
or an error.
Version 6
Beta (v0.0.1)
Similarly, the removeReaction
function allows users to remove a previously added reaction from a reference. This provides users with greater control over their engagement with the content and allows them to change their mind or update their reaction to the post or comment over time.
You can remove a reaction from a reference by calling removeReaction
.
reactionName
- name of the reaction that you will remove. Reaction name is case sensitive, i.e "like" & "Like" are two different reactions.
referenceId
- ID of the post or comment respectively.
The method returns a promise. If the reaction is successfully removed, the method will return true
. Otherwise, it will return false
or an error.
Version 6
Beta (v0.0.1)
The joinCommunity
function works by adding the active user as a member of the specified community. By becoming a member of a community within your app, users can connect with like-minded individuals and build deeper relationships within the community. To join a community, you simply need to pass the specific community ID as a parameter of the joinCommunity
function.
Version 6
Beta (v0.0.1)
The leaveCommunity
function works by removing the active user as a member of the specified community. This removes the user's access to the community feed and disables their ability to post messages or participate in community discussions. To leave a community, you simply need to pass the specific community ID as a parameter of the leaveCommunity
function.
Version 6
Beta (v0.0.1)
Let your users showcase their unique personality right in their timelines
Amity Social Cloud SDK provides a powerful Feed feature that allows users to stay informed, communicate, and express themselves through ranked posts. The Feed feature is comprised of a collection of posts, with three distinct types of feeds available to users: User Feed, Community Feed, and Global Feed.
User Feed: provides a collection of posts that are curated for a user's timeline. This feed is tailored to the individual user, providing relevant post that they generated.
Community Feed: on the other hand, is a collection of posts generated by members of a particular community. This feed allows users to stay connected and engaged with other members of their community, fostering a sense of belonging and shared experience.
Global Feed: aggregates both User and Community feeds, providing a comprehensive view of all relevant content in the user's network. This feed ensures that users can stay up-to-date with all the latest content and conversations in their network, promoting engagement and participation in the community.
By providing these three distinct types of feeds, the SDK enables users to customize their content experience, ensuring that they receive relevant and engaging content that reflects their interests and preferences. This feature can help to foster a vibrant and dynamic community, promoting engagement, communication, and collaboration among users.
Feed management methods are all contained in AmityFeedRepository
class. For querying posts from User Feed and Community Feed, please refer to - Query Post.
Supported ✅ (Please wait while we prepare a real example!)
Build and nurture vibrant communities where users can exchange and connect
Amity Social Cloud includes a powerful Community feature that allows users to share their thoughts and engage with each other within your app. By harnessing the power of communities, you can create a more dynamic and engaging user experience, promoting collaboration, communication, and participation among users.
Community provides users with a dedicated space to discuss specific topics or interests, enabling them to connect with like-minded individuals and build deeper relationships within the community. By providing a structured and organized approach to community engagement, Community can help to foster a more engaged and supportive community, promoting greater participation and collaboration among users.
Our product provides two types of communities: public and private.
Public - A public community is visible to anyone without any specific permissions. This means that anyone can find and join the community, and all content posted within the community is visible to anyone who has access to the community.
Private - On the other hand, a private community is only visible to the creator and invited members. This type of community provides greater privacy and control over the content shared within the community. Only members who have been invited to join the community can see and interact with the content and other members within the community.
Our product is designed to provide users with flexibility and control over their communities, allowing them to choose the type of community that best fits their needs and preferences.
Community Post Settings allows the community creator and community moderators to control who can create posts within a community and how those posts are moderated.
There are three possible options for Community Post Settings :
anyoneCanPost
: This setting allows anyone to create a post within the community and add it to the community feed immediately. There is no moderation required for these posts.
adminReviewPostRequired
: This setting allows users to create posts within the community, but adds another layer of moderation. Community moderators can review each post and decide whether or not it should be included in the community feed.
onlyAdminCanPost
: This setting restricts post creation to community moderators only. Regular users are not able to create posts within the community.
To check the community post settings, users can call the postSettings
property, which returns a CommunityPostSettings
object. This allows community administrators to easily manage and adjust their community settings to meet the needs of their community and ensure a positive user experience.
By default, the postSettings
value is set to anyoneCanPost
. In this case, member's posts will be displayed in the community feed without any review from admin.
To retrieve a list of community members, users can call the relevant method and provide the desired membership options and sorting parameters. For example, they may choose to sort the list of members by name or by date created, or they may specify certain membership options, such as only retrieving members who are not banned. The result of the method will always return as Live collection.
To query community members with certain criteria, the following parameters are used:
membershipOptions
: allows users to filter the results based on the membership status of community members. Passing an empty option or not passing and option set for membershipOptions
parameter will default to member
.
member
- will filter out all banned members and only include unbanned members.
ban
- will only include banned members in the results.
roles
: allows users to query for members with default moderator roles by using "channel-moderator" or "community-moderator" as the value. At this moment, we do not have a way to query for member-only roles. For custom roles assigned to members, users can pass in the roleId
of the custom role to filter members by this role.
sortBy
: allows users to specify the sorting method for the returned collection. The possible values include firstCreated
, lastCreated
. The firstCreated
sort option will be specified by default if it isn't specified. When a keyword is provided, leading to a list sorted by search rank.
To query community banned members, only the 'Admin' role is currently allowed, while 'Moderators' and 'Users' are not allowed to query community banned members.
Please note that you can only assign custom roles to a member in a community via the SDK. This feature is not yet available in the Amity Console.
If you assign a custom role to a user via the Amity console, the role will only be applied at the user level and not at the community level, and if you try to query for a member with this custom role, no results will be returned.
Passing an empty option set for membershipOptions
parameter will default to .member
.
Below is the sample code to get a list of community members. This method will return a LiveCollection
instance.
Version 6
Beta(v0.0.1)
To search for community members, users can call the relevant method and provide the desired keyword, roles and membership options parameters. For example, they may specify certain membership options, such as only retrieving members who are not banned. The result of the method will always return as Live collection.
If no keyword is supplied, the list of users for the specified community will be sorted by the date they joined.
To search for community members with certain criteria, the following parameters are used:
keyword
: allows users to specify the keyword to search for. The result contain members with either matching displayName
or userId
membershipOptions
: allows users to filter the results based on the membership status of community members. Passing an empty option or not passing and option set for membershipOptions
parameter will default to member
.
member
- will filter out all banned members and only include unbanned members.
ban
- will only include banned members in the results.
roles
: allows users to query for members with default moderator roles by using "channel-moderator" or "community-moderator" as the value. At this moment, we do not have a way to query for member-only roles. For custom roles assigned to members, users can pass in the roleId
of the custom role to filter members by this role.
To query community banned members, only the 'Admin' role is currently allowed, while 'Moderators' and 'Users' are not allowed to query community banned members.
Amity Community Moderation provides a way to moderate the community by multiple ways. This provides another layer of control over community member access and permissions, allowing the creator or admin to manage the community more effectively and ensure that members have the appropriate roles and permissions to perform their duties within the community.
To add roles to community members, users can provide the roles
and userIds
as parameters, specifying which roles should be added to which members.
Version 6
Beta (v0.0.1)
Similarly, to remove roles from community members, users can provide the roles
and userIds
as parameters, specifying which roles should be removed from which members.
Version 6
Beta (v0.0.1)
addRoles
and removeRoles
do not create new roles but assign and remove existing roles from given users. You can add or remove default roles as well as custom roles.
To add members to a community, users can specify the userIds
and communityId
of the members they want to add. This function will add the specified users to the specified community, granting them access to the community and its content.
Version 6
Beta (v0.0.1)
To remove members from a community, users can specify the userIds
and communityId
of the members they want to remove. This function will remove the specified users from the specified community, revoking their access to the community and its content.
Version 6
Beta (v0.0.1)
The banMembers
method accepts an array of userId
as a parameter, which allows the creator or moderators of a community to ban multiple members at once. This feature provides a quick and efficient way to enforce community rules and ensure that members who violate those rules are appropriately restricted.
Version 6
The unbanMembers
function accepts an array of userId
as a parameter, which allows the creator or moderators of a community to quickly remove the ban from multiple members. This feature can be useful when a banned member has corrected their behavior and is ready to rejoin the community.
Version 6
Note:
The community creator is automatically assigned as the community moderator.
The previous/last moderator is not allowed to leave a community and an error is displayed.
The community moderator can promote a user/member to moderator.
The community moderator can demote a moderator to a user/member.
This applies only to Live and Community channels’. This does not apply to Conversation Channel.
The SDK provides a convenient way for users to check their permissions within a community by using the Client.hasPermission
method.
To use this method, users can send one of the available Permission enums as a parameter to the method. The method will then check if the user has the specified permission within the community and return a boolean value indicating whether or not the user has that permission.
Supported ✅ (please wait while we prepare a real example!)
Supported ✅ (please wait while we prepare a real example!)
Supported ✅ (please wait while we prepare a real example!)
The update community method works by providing moderators or a creator of the community with a way to modify various aspects of their community settings. For example, moderators can update the community name, description, or avatar to reflect changes in the community. They can also update the post settings to control who can create posts in the community.
displayName
- allows users to set the public display name of the community, which will be visible to other users who can access the community.
description
- allows users to provide a description of the community, which can help other users understand the purpose and focus of the community.
isPublic
- is used to specify the type of the community. Setting it to false
will create a private community, while setting it to true
will create a public community.
postSettings
- allows users to customize the community post settings. This parameter can be used to configure how posts are moderated within the community, depending on the specific needs and preferences of the community creator.
storySettings
- allows users to customize the community story settings. This parameter can be used to configure whether to enable comment interaction on stories.
metaData
- allows users to include additional properties to support custom fields within the community. This can be useful for creating communities with specific requirements or features that are not available by default in our platform.
Version 6
Beta (v0.0.1)
Please note that Flutter doesn't support updating post settings yet.
By default, only the original creator of the community or the system administrators can update the community.
The SDK provides a way for creators or moderators to delete a community by calling the deleteCommunity
method. In the JavaScript SDK, this method is referred to as the closeCommunity
method.
To delete a community using this method, users can call the method and provide the communityId
as a parameter. This will trigger the deletion process, which will remove the community and associated community data.
It is important to note that deleting a community is a permanent action and cannot be undone. As such, it is recommended that users exercise caution when deciding to delete a community and ensure that they have taken all necessary precautions to preserve any important content or data associated with the community.
Version 6
Beta (v0.0.1)
The queryCommunities
method can be useful for users who are new to your app or are exploring their community options. By providing a way to explore for communities, you can help users to discover the full range of community options available within your app.
To query communities with certain criteria, the following parameters are used:
displayName
allows you to filter communities based on the community's displayName.
filter/membership
allows you filter communities based on the logged-in user membership status.
categoryId
allows you filter communities based on community categories.
sortBy
allows you filter communities based on the order that the communities were created or based on alphabetical order, last created, and first created.
includeDeleted
allows you specify if you want to include deleted communities in your query. By passing true
or false
to this method, you can include or exclude deleted communities from the results.
If you'd like to fetch all communities, you can pass the keyword as null
.
Version 6
Beta(v0.0.1)
The CommunityRepository also provides a way to manage community categories. When communities are placed into categories, users can easily sort and filter communities based on their category, allowing for more efficient and effective community management.
Note: Categories can only be created and updated from Amity Social Cloud Console.
To get a particular community category, users can utilize the getCategory
method provided by the CommunityRepository. This method accepts a categoryId
as a parameter and returns information about the specified category.
The functionality isn't currently supported by this SDK.
Version 6
Beta (v0.0.1)
The functionality isn't currently supported by this SDK.
CommunityRepository also provides the categoryQuery
method, which allows users to obtain the categories currently available on the system. This method returns a collection of categories.
To query community categories with certain criteria, the following parameters are used:
sortBy
allows you filter communities based on the order that the community categories were created or based on alphabetical order, last created, and first created.
includeDeleted
allows you specify if you want to include deleted community categories in your query. By passing true
or false
to this method, you can include or exclude deleted community categories from the results.
Version 6 and Beta(v0.0.1)
The SDK product provides two important methods for managing follow requests between users: accept follow request and decline follow request. These methods enable users to accept or decline requests to follow other users within the app, promoting a more personalized and engaging user experience.
To accept a follow request from another user, users can call the acceptMyFollower
method within the SDK and provide the userId
of the user whose follow request they wish to accept. This will add the user to the list of followers and allow them to receive updates within Global feed and User feed.
Version 6
Beta (v0.0.1)
Similarly, to decline a follow request from another user, users can call the declineMyFollower
method within the SDK and provide the userId
of the user whose follow request they wish to decline. This will remove the user's request to follow and prevent them from receiving updates within Global feed and User feed.
Version 6
Beta (v0.0.1)
If the Follower request is no longer available (either the follower request sender has withdrawn the request or the request has been accepted or declined before), SDK will return the error message.
This feature allows users to block and unblock other users, manage their list of blocked users, and interact with the users accordingly. The block and unblock features play an important roles in user experience and maintaining a safe, positive environment within a platform or community.
User safety and privacy: The block feature allows users to protect themselves from unwanted interactions, harassment, or cyberbullying. By blocking another user, they can prevent the blocked user from viewing their content and engaging with them on the platform.
Control over personal space: Users can maintain control over their online environment by choosing who they interact with and whose content they want to see. Blocking helps users curate their experience on the platform to match their preferences and comfort levels.
Reducing spam and inappropriate content: Blocking enables users to filter out spam or content that they find offensive or irrelevant. This helps maintain a more pleasant experience for the user and reduces the negative impact that spam or inappropriate content can have on the platform's overall quality.
Blocked users content in global feed, community feed, or user feed will be hidden
Search user functionality will function normally, blocked users will still be visible.
Some interactions will be disabled such as:
create a post on a blocker's user feed
create a comment on a blocker's user posts* (please read limitations in the last section)
add or remove reactions on a blocker's posts
The on the blocked user will become none
and the blocker will not be able to follow the blocked user.
Blocked users content in global feed, community feed, or user feed content will be visible
All prohibited Interactions will be enabled as mentioned above.
The connection status on the blocked user will retain none
regardless of the previous connection, and the blocker will be able to follow the unblocked user again.
Users can block other users with the following constraints:
Only users can be blocked, not Console Admins or communities.
Community moderators or custom roles can be blocked, regardless of their roles.
When Alice blocks Bob:
Alice can block Bob regardless of their connection status.
Bob won't be notified of the block and can still block Alice.
Bob's roles and community memberships remain unchanged.
Here's the explanation of the parameter:
userId
: This is a required parameter of type String
that represents the unique identifier of the user you want to block.
Users can also unblock blocked users with the following constraints:
Their connection status will not return to the state before the block if they were connected. The connection status will always be none
.
If Alice was following Bob, they'll need to reconnect with Bob after unblocking.
If Alice and Bob were not connected, the connection status will remain none
upon unblocking.
Here's the explanation of the parameter:
userId
: This is a required parameter of type String
that represents the unique identifier of the user you want to unblock.
Users can view and manage a list of users they've blocked. The list will display:
User ID
Display Name
Avatar
Other relevant user information
Blocked users that are inactive or deleted will not be shown in the list. Users can only view users they've blocked and not the users that have blocked them.
While the block and unblock features offer several benefits, there are limitations to their capabilities:
Interaction with Content
Blocking does not completely restrict interactions with the blocked user's content in the following scenarios:
If Alice blocks Bob, and either of them knows the other's post ID, they can still comment on or react to each other's posts.
Content Notifications
Blocking does not affect notifications related to blocked users:
If Alice or Bob creates a post in a community they are both members of, they will still receive notifications about the post created by the other person.
No user-blocking related real-time events are provided to the SDK.
Filtering blocked users' RTE is not supported. For example, if Alice and Bob subscribe to the same community feed and one of them creates a post, the other will still receive the post-created event.
To follow other users using our SDK, the process is straightforward and easy to use. Simply pass the userId
of the user you want to follow, and our SDK will handle the rest.
Once you have identified the user you wish to follow, you can use our SDK's followUser
method to initiate the follow request. The method will handle the request process, whether it requires the target user's acceptance or not, depending on the .
To unfollow a user, simply call the unfollowUser
method with the userId
of the user you wish to unfollow. The method will handle the unfollow process, removing the connection between the two users and updating the following and follower counters accordingly.
Use our social SDK to enable social features such as Feeds, Groups, Profiles, Content Posts, and Social Media Type Interactions for all platforms
We now support the Ionic framework in building your application using our web SDK. You can use our Social natively to support your mobile or web applications built using the Ionic framework.
Since Ionic is an HTML5 framework, it needs a native wrapper to access native SDK functionalities and run as a native app. We recommend using Capacitor.
Capacitor will wrap your application in a native container so you can easily integrate our web SDK to run on iOS, Android, and Web platforms.
We will walk you through the process of installing ionic and all the necessary dependencies for development.
Ionic comes with a convenient command line utility to start, build, and package Ionic apps. To install it, simply run:
In the root of your application, install Capacitor:
Now, we need to copy the native platform template into your application:
To open the application in your IDE, run:
For Android, it will open Android Studio. For iOS, it will open Xcode.
Now you’re ready to start integrating our social SDK into your application.
Following relationships are a key component of social networks and are essential for creating connections between users in social features. These connections are used to determine the visibility and accessibility of data in user feeds and global feed.
Currently, our SDK provides a one-directional relationship between users. For example, when user A follows user B, the system will know that user A has connected with user B. However, user B does not necessarily have to follow user A in return.
To create relationships with other users, our SDK provides two methods:
With request process: In this method, once a user sends a "Follow" action to the target userId
, the system will send a request to the target user. The connection will not be established until the target user accepts the follow request.
Without request process: In this method, once a user sends a "Follow" action to the target userId
, the system will automatically establish the connection between the two users without requiring the target user to accept the follow request.
By providing these connection methods, our platform allows users to create and manage social connections effectively and efficiently, based on their specific needs and preferences.
The default connection method is the With request process. If you wish to change the connection method, you can contact our.
Alice will see Bob's as blocked
.
Bob will see Alice's as none
.
Name
Data Type
Description
communityId
String
ID of the community
channelId
String
ID of the channel
userId
String
ID of the user who created the comment
displayName
String
Community name for displaying
avatar
Object
Avatar object
description
String
Description of the community
isOfficial
Boolean
Is this community official?
isPublic
Boolean
Is this community public?
onlyAdminCanPost
Boolean
only admins can post in this community
tags
List
List of tags used for searching
metadata
Object
Additional properties to support custom fields
postsCount
Integer
Number of posts in community
membersCount
Integer
Number of members in community
isJoined
Boolean
Is this community joined?
categoryIds
List
ID of categories
isDeleted
Boolean
Is this community deleted?
createdAt
DateTime
Date/time when the community was created
updatedAt
DateTime
Date/time when a community is updated or deleted
hasFlaggedPost
Boolean
Flag for checking internally if post inside community is reported or not
postSettings
Object
Community post settings within a community, how posts are moderated
platform |
The platform template to add (e.g. |
platform |
Description: The platform you are using (e.g. |
The Amity Social SDK offers the getLatestComment
method, allowing you to fetch the most recent comment by a reference within your application. Integrating this feature enhances the user experience by keeping them informed about the latest interactions among users.
Using the getLatestComment
method is straightforward: simply implement it to retrieve the latest comment by a reference, streamlining the process of accessing up-to-date information. Furthermore, the method returns a Live Object that you can observe for real-time updates once Realtime Events are subscribed, ensuring your app stays current with the latest comments and fostering a more interactive environment.
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
Supported ✅ (Please wait while we prepare a real example!)
Refer to Comment reference type for a more detailed explanation of the reference type parameter.
Amity Social SDK provides a comment editing functionality that fosters accountability and user awareness within your application. This feature enables users to edit their own comments exclusively. Users can only edit their own comments, which encourages responsible interactions and maintains accountability. Upon completing an edit operation, the SDK updates the editedAt
property to the current time, reflecting the changes made by the user. You can then leverage the updated editedAt
timestamp to create a user interface that informs users of edited comments, fostering transparency.
For any editing operation - either update or delete a comment, you can use APIs from AmityCommentRepository
.
Version 6
Beta (v0.0.1)
Amity Social SDK extends its comment editing functionality to include images, allowing users to update their comments with images. This feature enables users to modify not only the text but also the images associated with their comments, providing a richer and more engaging experience for your app's audience.
Prior to editing images in comments, it is crucial to upload the images that will be included in the comment data to ensure that the necessary information is accessible and can be linked to the comment. This requires uploading the file first, to obtain the file data that will be used in creating the file post. To upload a file, please refer to #upload-images.
Upon successful completion of the file upload process, you can include the image data as a parameter when updating comments as demonstrated in the code sample below.
The functionality isn't currently supported by this SDK.
Version 6
Beta (v0.0.1)
The functionality isn't currently supported by this SDK.
Refer to the following Limitations on the use of images in comments.
Let users react to messages, posts, and comments, which are visible to others
Reactions are the interactions that users can perform on messages, posts, or comments. The interactions can be anything such as like, dislike, love, etc. It's up to the client to determine the type of reactions. The SDK provides convenient functions to add, remove, and query reactions for any content. Currently, reactions are supported for Posts, Messages, and Comments.
The Social SDK provides two reference types for querying reactions: comment reference type and post reference type.
Comment Reference Type: allows users to query reactions made on a specific comment. This is useful when users want to see how others have responded to a particular comment.
Post Reference Type: allows users to query reactions made on a specific post. This is helpful when users want to see how others have engaged with a particular piece of post.
Name
Data Type
Description
Attributes
referenceId
String
ID of a document
referenceType
String
Type of document
reactionName
String
Name of reaction
'like
', 'love
' , 'wow
'
reactionId
String
ID of the reaction
reactorId
String
ID of the reactor
reactorDisplayName
String
Display name of the reactor
createdAt
DateTime
The date/time when a reaction is created
To further facilitate the management of reactions in your app, the Social SDK product includes a getReactions
method that allows you to retrieve information about a specific reaction or all reactions on a comment and post.
Using this method, you can fetch detailed information about a particular reaction, including the user who made the reaction, the timestamp of the reaction, and any additional metadata associated with the reaction. This can be useful for analyzing the sentiment of the community and gaining insights into the types of content that are resonating with your users.
To query getReactions
you'll need to simply provide referenceType
and referenceId
to query specific type of reactions. For further information regarding reaction reference types, please see - #create-comment.
Each post, comment, message has a set of fields providing detailed info about reactions.
reactionsCount
- how many reactions the post has
myReactions
- list of reactions you added to the post
reactions
- map that tells how many reactions of a certain type a post has
Version 6
Beta(v0.0.1)
To retrieve Live collection of followers for a particular user, simply call the getFollowerList
method with the userId
of the user whose follower list you wish to retrieve. The method will return a collection of follow relationship objects, each of which includes information about the target user, the source, and #follow-status of those two users.
The list of users following me will be arranged chronologically by the date they started following me. While there is no sorting parameter available, the default ordering is determined by the date of the follow action.
Additionally, our platform allows you to filter the follower list by follow status by passing the status
parameter. For example:
accept
filter to retrieve only the followers who you have already accepted their requests.
pending
filter to retrieve the list of users who have sent you a following request. Please note that this filter can only be applied if the connection method configuration is With request process.
We currently do not support sorting of the follower user list.
The getFollowingList
method returns Live collection of follow relationship objects, each of which includes information about the target user, the source, and the follow status of those two users. This information can be used to better understand the user's social network and manage their following more effectively.
The list of users I am following will be arranged chronologically by the date I started following them. Although no sorting parameter is applicable, the default order is based on the date of the follow action.
accept
filter to retrieve only the users whom have already accepted your follow request.
pending
filter for retrieve the users whom you whom have not yet accepted your follow request. Please note that this filter can only be applied if the connection method configuration is With request process.
We currently do not support sorting of the following user list.
Before following other users, it is important to verify the connection status of the target user. Our SDK provides three statuses to indicate the connection status of the target user:
accept
: This status means that the target user has already connected.
pending
: This status means that the target user has received a follow request, but has not yet accepted it. This status is only available when the connection method setting is .
none
: This status means that the target user has not yet connected.
blocked
: This status means that the target user has been blocked by the current user. For further information regarding blocked/unblocked users, please visit .
In addition to these statuses, our SDK also provides information about the following and follower count of the target user:
followingCount
: This is the total number of users that the target user is following.
followerCount
: This is the total number of users who are following the target user.
pendingCount
: This is the total number of follow requests that the target user has received.
By providing this information, our product allows users to manage their social connections effectively and efficiently, based on their specific needs and preferences.
The follow feature functionalities are packed in AmityUserRepository
and are able to be called via userRelationship
.
To get the current user follow information, use getMyFollowInfo
.
To get the other's user follow information, use getFollowInfo
with the userId
parameter.
To get the current user follow information, use the code below.
To get the other's user follow information, use the code below with the userId
parameter.
Version 6
Beta (v0.0.1)
To get the current user follow information, use the code below.
To get the other's user follow information, use the code below with the userId
parameter.
By presenting users with a list of trending communities, and recommending communities, the SDK can help to promote a more dynamic and engaging user experience within your app. This can help to foster greater engagement, collaboration, and communication among members, promoting a more supportive and inclusive community atmosphere.
The getTrendingCommunities
method works by identifying communities that are currently having high levels of members where the user may or may not be part of.
Version 6
Beta (v0.0.1)
The getRecommendedCommunities
method works by identifying communities that are currently having high levels of members where the user is not be part of.
Version 6
Beta (v0.0.1)
Note: You can fetch a maximum of 15 items from the trending and recommendation communities at once.