> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Viewing Post Content

> Render post text, child media, polls, live stream data, room data, and local counts from returned SDK post objects.

Posts can contain text directly and can also reference child posts for media attachments. Query and get APIs return composed post objects where each SDK exposes helpers for reading the post data.

## Parameters

| Operation            | Parameter   | Required | Description                                                                                           |
| -------------------- | ----------- | -------- | ----------------------------------------------------------------------------------------------------- |
| Inspect post content | Post object | Yes      | Post returned from a get or query API. Use SDK helper methods or typed data accessors on that object. |

## Parent and Child Posts

Media posts commonly use a parent-child shape:

* The parent post carries the main feed item and text.
* Child posts carry individual media attachments such as images, videos, and files.
* SDK helpers expose composed children where the platform supports them.

<CodeGroup>
  ```typescript TypeScript theme={null}
  function inspectPostContent(post: Amity.Post) {
    const childCount = post.childrenPosts.length;
    const localCommentCount = post.localCommentCount;

    const image = post.getImageInfo();
    const video = post.getVideoInfo();
    const videoThumbnail = post.getVideoThumbnailInfo();
    const file = post.getFileInfo();
    const poll = post.getPollInfo();
    const audio = post.getAudioInfo();
    const clip = post.getClipInfo();
    const room = post.getRoomInfo();

    renderResults({
      childCount,
      localCommentCount,
      image,
      video,
      videoThumbnail,
      file,
      poll,
      audio,
      clip,
      room,
    });
  }
  ```

  ```swift iOS theme={null}
  func inspectPostContent(_ post: AmityPost) {
      let childCount = post.childrenPosts.count
      let localCommentCount = post.localCommentCount

      let image = post.getImageInfo()
      let video = post.getVideoInfo()
      let videoThumbnail = post.getVideoThumbnailInfo()
      let file = post.getFileInfo()
      let poll = post.getPollInfo()
      let audio = post.getAudioInfo()
      let clip = post.getClipInfo()
      let room = post.getRoomInfo()

      showSuccessMessage([
          childCount,
          localCommentCount,
          image?.fileId,
          video?.fileId,
          videoThumbnail?.fileId,
          file?.fileId,
          poll?.pollId,
          audio?.fileId,
          clip?.fileId,
          room?.roomId
      ])
  }
  ```

  ```kotlin Android theme={null}
  fun inspectPostContent(post: AmityPost) {
      val children = post.getChildren()
      val localCommentCount = post.getLocalCommentCount()

      when (val data = post.getData()) {
          is AmityPost.Data.TEXT -> showSuccessMessage(data.getText())
          is AmityPost.Data.IMAGE -> showSuccessMessage(data.getImage() ?: "")
          is AmityPost.Data.FILE -> showSuccessMessage(data.getFile() ?: "")
          is AmityPost.Data.AUDIO -> showSuccessMessage(data.getAudio() ?: "")
          is AmityPost.Data.VIDEO -> showSuccessMessage(data.getThumbnailImage() ?: "")
          is AmityPost.Data.CLIP -> showSuccessMessage(data.getThumbnailImage() ?: "")
          is AmityPost.Data.LIVE_STREAM -> showSuccessMessage(data.getPostId())
          is AmityPost.Data.ROOM -> showSuccessMessage(data.getRoom() ?: "")
          is AmityPost.Data.POLL -> showSuccessMessage(data.getPollId())
          is AmityPost.Data.CUSTOM -> showSuccessMessage(data.getDataType())
      }

      showSuccessMessage(children.size + localCommentCount)
  }
  ```

  ```dart Flutter theme={null}
  void inspectPostContent(AmityPost post) {
    final children = post.children ?? <AmityPost>[];
    final commentCount = post.commentCount ?? 0;
    final data = post.data;

    if (data is TextData) {
      final text = data.text;
    } else if (data is ImageData) {
      final imageUrl = data.getUrl(AmityImageSize.MEDIUM);
    } else if (data is FileData) {
      final file = data.file;
    } else if (data is VideoData) {
      final thumbnail = data.thumbnail;
    } else if (data is LiveStreamData) {
      final streamId = data.streamId;
    } else if (data is PollData) {
      final pollId = data.pollId;
    } else if (data is CustomData) {
      final rawData = data.rawData;
    }

    final childCount = children.length;
    final total = childCount + commentCount;
  }
  ```
</CodeGroup>

## Platform Notes

| Platform   | Content helpers                                                                                                                                                                                      |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TypeScript | Linked post helpers include `childrenPosts`, `getImageInfo()`, `getVideoInfo()`, `getVideoThumbnailInfo()`, `getFileInfo()`, `getPollInfo()`, `getAudioInfo()`, `getClipInfo()`, and `getRoomInfo()` |
| iOS        | `AmityPost` exposes `childrenPosts` plus helper methods for image, video, thumbnail, file, poll, audio, clip, and room data                                                                          |
| Android    | `AmityPost.getData()` returns a sealed data type; inspect it with `when` and use data-specific methods                                                                                               |
| Flutter    | Current public model exposes text, image, video, file, live stream, poll, and custom data classes; audio, clip, and room post data classes are not exposed in the current public model               |

## Rendering Guidance

* Prefer SDK helper methods over reading raw data maps when helpers exist.
* Handle unknown or custom data types gracefully; custom post types are application-defined.
* For video and clip playback, read the media object first and choose a URL or resolution your UI can render.
* For room posts, check room status before presenting live or recorded playback UI.
* Use `localCommentCount` where exposed when your UI should include replies in the visible comment count.

## Related Topics

<CardGroup cols={3}>
  <Card title="Query Posts" icon="filter" href="./query-posts">
    Query live post collections before rendering
  </Card>

  <Card title="Mixed Media Posts" icon="images" href="../creation/mixed-media-post">
    Create posts with multiple media attachment types
  </Card>

  <Card title="Room Posts" icon="users-viewfinder" href="../creation/room-post">
    Create room posts for live room experiences
  </Card>
</CardGroup>
