Access Post Information

Each post is represented by AmityPost instance. Each instance of AmityPost holds several information such as data, reactions, comments, metadata, child posts, etc. For text post, you can access the actual data of the post through data property.

Post with images or files follow Parent - Child relationship. Each images or files uploaded will be a separate child post. Any text that you set while creating image/file post will act as a Parent post. Parent post contains childrenPosts property which gives you an array of AmityPost.

You can access data for child post through the same data property for child post. Alternatively, you can also access more details about uploaded files and images through getFileInfo() or getImageInfo() method.

Let's consider our post contains some text and one image. This means the parent post would be a text post and its child post will be an image post. Here is how we can access it.

Last updated