Post creation page
This page provides a form for post creation.
The default state of post creation

Types of post creations:

Text

example of text post
Example of hyperlink generated from URL input
Mention users in a post

Text and Images

User can select images from 2 sources.

Device Camera

System will launch the device camera view

Text and Files

Text and Videos

Polls

Poll post
Mention users in a poll post

Livestream

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

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:
  1. 1.
    AmityPostAttachmentItem.PHOTO
  2. 2.
    AmityPostAttachmentItem.VIDEO
  3. 3.
    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
1
//for text, image, file, video post
2
AmityPostCreatorFragment.newInstance()
3
.onCommunityFeed(community or communityId)
4
//optional
5
.allowPostAttachments(
6
listOf(
7
AmityPostAttachmentOptionItem.PHOTO,
8
AmityPostAttachmentOptionItem.VIDEO,
9
AmityPostAttachmentOptionItem.FILE
10
)
11
)
12
.build()
13
14
//for poll post
15
AmityPollPostCreatorFragment.newInstance()
16
.onCommunityFeed(community or communityId)
17
.build()
Copied!
Create a post on user's own feed
1
//for text, image, file, video post
2
AmityPostCreatorFragment.newInstance()
3
.onMyFeed()
4
//optional
5
.allowPostAttachments(
6
listOf(
7
AmityPostAttachmentOptionItem.PHOTO,
8
AmityPostAttachmentOptionItem.VIDEO,
9
AmityPostAttachmentOptionItem.FILE
10
)
11
)
12
.build()
13
14
//for poll post
15
AmityPollPostCreatorFragment.newInstance()
16
.onMyFeed()
17
.build()
Copied!