Get Story Targets

Get Story Target

The 'getStoryTarget()' function in the AmitySDK enables real-time observation of StoryTarget based on specified target. This function returns a LiveObject of StoryTarget, enabling users to receive updates and check whether the target possesses unseen stories. For example, you can call this method if you'd like to implement an unseen story ring for your story feed.

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.

Get Story Targets

In addition to the getStoryTarget()function, the AmitySDK provides 'getStoryTargets()' function to enable retrieval of multiple StoryTargets. This function takes an input as an array of targets and returns a LiveCollection of StoryTargets, enabling users to observe updates of multiple StoryTargets.

Here's an explanation of the function parameter:

  • targets: Represents an array of pairs of targetType and targetId

The function can accept a maximum of 10 pairs of targets in the array.

Last updated