Post Creation Page
This page provides a form for post creation.

Types of Post Creations:
Text



Text and Images

User can select images from 2 sources.
Device Camera

Device Image Gallery

Text and Files


Text and Videos


Polls


Livestream
To create a live stream post and for a detailed discussion on the live stream features, refer to Livestream post documentation.

Features
Feature
Description
Post creation
User can create post by adding content such as text, images, videos and files.
Mention in post
Mention users in post by typing @ to activate mention suggestion and selecting their names in the suggestion list. Up to 30 users can be mentioned per post.
An alert will be shown if character count is greater than 50000 or mentions count is greater than 30.
Usage
Create a Fragment
User can create a post either on a community feed or user's own feed.
Attachment options
We currently support three types of attachment option when creating a post. These are:
AmityPostAttachmentItem.PHOTO
AmityPostAttachmentItem.VIDEO
AmityPostAttachmentItem.FILE
.
You can optionally choose to allow these attachment options by using the method allowPostAttchments
. By default the fragment includes all attachment options.
Create a post on community feed
//for text, image, file, video post
AmityPostCreatorFragment.newInstance()
.onCommunityFeed(community or communityId)
//optional
.allowPostAttachments(
listOf(
AmityPostAttachmentOptionItem.PHOTO,
AmityPostAttachmentOptionItem.VIDEO,
AmityPostAttachmentOptionItem.FILE
)
)
.build()
//for poll post
AmityPollPostCreatorFragment.newInstance()
.onCommunityFeed(community or communityId)
.build()
Create a post on user's own feed
//for text, image, file, video post
AmityPostCreatorFragment.newInstance()
.onMyFeed()
//optional
.allowPostAttachments(
listOf(
AmityPostAttachmentOptionItem.PHOTO,
AmityPostAttachmentOptionItem.VIDEO,
AmityPostAttachmentOptionItem.FILE
)
)
.build()
//for poll post
AmityPollPostCreatorFragment.newInstance()
.onMyFeed()
.build()
Last updated
Was this helpful?