Post Query
The Social SDK product includes a powerful Posts Query method that allows users to search for and retrieve posts that match specific criteria. This functionality is useful for a variety of use cases and provides a flexible and customizable approach to managing and displaying content in your app. Furthermore, the result of the method will always return as Live collection.
Posts Query API can be useful for the use cases that require flattening the search and results. For example:
- Media gallery that shows the list of all images, posted by a user
- List of all the text posts that are deleted in a community
The Posts Query method is capable of retrieving and searching all posts on the server that match the specified criteria, which are:
targetId
- ID of the community or user respectively.targetType
- Type of the target, either a particular community or a user feed.types
- available post types arevideo
,image
,file
,liveStream
,poll
andcustom
post. Alternatively, if you don't specify a particular post type, it will return all post types for a specific target.includeDeleted
- Deletion filter. By setting the boolean totrue
, it will return both deleted and non-deleted posts. On the other hand, if the boolean is set tofalse
, it will only return non-deleted posts. By default, the boolean is set tofalse
.sortBy
- When it is set to "lastCreated", the most recently created posts will appear at the top of the result. Conversely, when the "sortOption" is set to "firstCreated", the earliest created posts will be displayed at the top of the result.
iOS
Android
JavaScript
TypeScript
Flutter
In Flutter SDK, supported query post types are "
video
", "image
" and "file
".For custom post, follow a namespace like format.
Example: "
my.customtype
" Last modified 4h ago