Links

Comment Query

The ability to query comments and their replies is essential for creating a robust and user-friendly commenting experience. By using the getComments() method and passing in the appropriate parameters, you can retrieve the comments and replies that are most relevant to your users.
Comment Replies
The query returns a LiveCollection of all matching comments available. To retrieve replies to a specific comment, you can pass the commentId as the parentId. If you want to retrieve parent-level comments, pass parentId = null. If you omit the parentId, you'll receive all comments on all levels.
Deletion Filter
You can also use the includeDeleted() method to query for deleted comments and their replies. By passing true or false to this method, you can include or exclude deleted comments from the results.
Note that if you use the includeDeleted() method, you don't need to check the isDeleted() method in the AmityComment object for deleted comments.
iOS
Android
JavaScript
TypeScript
Flutter

Pagination

When querying comments, you cannot set limit, skip, after, first, before, and last parameters. By default, the number of items in each page is 20. To handle pagination to load more comments, refer to Pagination in Live Collections.

Pagination

When querying comments, you cannot set limit, skip, after, first, before, and last parameters. By default, the number of items in each page is 20. To handle pagination to load more comments, refer to Pagination in Live Collections.
Refer to Comment Reference Type for a more detailed explanation of the referenceType parameter.

Query Comments with Images

To query for image comments only, you can use the dataTypes parameter and pass the value TEXT , IMAGE, or both. There are two options for the dataTypes parameter: any and exact.
  • any - When you use the any option, the retrieved comments will include any comment that contains at least one of the specified data types. For example, if you pass [image, text], the retrieved comments may contain only image content, only text content, or both image and text content.
  • exact - On the other hand, when you use the exact option, the retrieved comments will include only comments that contain all of the specified data types. For example, if you pass [image, text], the retrieved comments must contain both image and text content. If you pass [image], the retrieved comments must contain only image content.
iOS
Android
JavaScript
TypeScript
Flutter
Using exact filer parameter:
Using any filter parameter:
The functionality isn't currently supported by this SDK.
The functionality isn't currently supported by this SDK.
Refer to the following Limitations on the use of images in comments.