Get Stories
Last updated
Last updated
The 'getActiveStories()
' function within the AmitySDK enables users to query non-expired stories based on a specified target, providing a LiveCollection of stories for seamless playback and browsing. Notably, the AmitySDK supports optimistic story creation, including unsynced stories within the collection. In sorting, priority is accorded to unsynced stories followed by synced ones, with secondary sorting based on the 'sortOption.' It is important to note that real-time exclusion of expired stories from LiveCollection is not supported.
This function requires two parameters: targetType, targetId.
Here's an explanation of the function parameters:
targetType
: Represents the type of target, currently supporting 'community.'
targetId
: Corresponds to the ID of the designated target.
sortOption
: Specifies the secondary sorting order for stories within the collection as 'firstCreated' or 'LastCreated.' The default value is 'firstCreated,' organizing stories chronologically based on creation time.