Post Creation Page

This page provides a form for post creation

The default state of post creation

Types of Post Creations:

Text

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

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. AmityPostAttachmentItem.PHOTO

  2. AmityPostAttachmentItem.VIDEO

  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

//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