Posts
Here's an overview of posts and how you can get started with integrating them into your applications
A feed is made up of a collection of posts. Users will be able to generate different types of posts as well as to react and comment on posts. SDK provides different builder classes to create each type of post. First, you need to build the post by using one of the builder classes. Then use the instance of AmityFeedRepository to actually create the post. createPost method requires instance of builder, targetId and targetType. TargetType is an enum with two cases, which are user and community.
If you want to create a post on a particular user's feed, you can provide the id of that user for targetId parameter and set the targetType to user. If you want to create a post on your own feed, set targetId to nil. If you want to post on a particular community, then targetType would be community.
A single post can have up to 20,000 characters. For custom post, JSON data must not exceed 100KB in size.

Post Description

Name
Data Type
Description
Attributes
postId
String
ID of the post
parentPostId
String
ID of the 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
"like", "love", etc...
commentsCount
Integer
Number of comments to the post
comments
Array.<String>
Comments to the post

Post Repository

To use all post features, you must create AmityPostRepository.
Export as PDF
Copy link