Post Creation Page
This page provides a form for post creation.
This is the default state of post creation

Text only

Example of how it looks for text only post
Example on how the hyperlink will look like in creation page and on the post component
Mention users in a text post

Text and Images

After image has been selected and showing in the post creation flow

User can select images from 2 sources.

Device Camera

System will launch the device camera view

Text and Files

System shows the device file picker
After the file has been selected. The system will show the file upload progress bar.

Text and Videos

Polls

You can create a poll post and other users can interact with that poll post by selecting from the poll options.
Creating a poll post
Mention users in a poll post

Live Stream

Mention users in a livestream post
To create a live stream post and for a detailed discussion on the live stream features, refer to Livestream post documentation.
Refer to our Live Stream documentation to enable live stream functionalities.

Features

Feature
Description
Post creation
Create post by adding content such as text, images, videos, and files. Refer to Supported types for more details.
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.

Supported types

  • File: All file types are supported
  • Image: JPG, JPEG, and PNG
  • Video: 3GP, AVI, FLV, MP4 and MPEG-2
  1. 1.
    The maximum file, image, or video size that you can upload is 1 GB.
  2. 2.
    Uploaded images or videos whose format is not supported (e.g. HEIC, HEVC) will be automatically converted to PNG for images and MP4 for videos.

Usage

Create a view controller
1
// Post to user feed
2
let viewController = AmityPostCreatorViewController.make(postTarget: .myFeed)
3
4
// Post to community feed
5
let viewController = AmityPostCreatorViewController.make(postTarget: .community(object: postModel))
6
7
// Poll post
8
let viewController = AmityPollCreatorViewController.make(postTarget: <your post target>)
9
self.present(viewController, animated: true, completion: nil)
Copied!
Parameter
Parameter
Description
postTarget
enums to determine where is the target feed consist of myFeed and community(AmityCommunityModel)
AmityCommunityModel is a wrapper class of AmityCommunity which is a live object from AmitySDK
Attachment options
By default AmityPostCreatorViewController allows all attachments when creating a post. You can optionally choose attachment options when creating the post.
All available attachment options are image, video, and file. These can be found in AmityPostAttachmentType.
1
// Only allow file attachment in post creator page.
2
let settings = AmityPostEditorSettings()
3
settings.allowPostAttachments = [.file]
4
let postCreator = AmityPostCreatorViewController.make(postTarget: postTarget, settings: settings)
Copied!