Activity Feeds V3 is in closed alpha — do not use it in production (just yet).

Reactions

Overview

You can react to both activities and comments. It’s possible to configure any reaction types that best fit your app.

// Add a reaction to an activity
val reaction: Result<FeedsReactionData> = feed.addReaction(
    activityId = "activity_123",
    request = AddReactionRequest(
        custom = mapOf("emoji" to "❤️"),
        type = "like"
    )
)

// Remove a reaction
val deleteResult: Result<FeedsReactionData> = feed.deleteReaction(
    activityId = "activity_123",
    type = "like"
)

By default creating a reaction doesn’t create an activity.

When you read a feed the reactions are included. Here’s an example:

feed.getOrCreate()
feed.state.activities.collect { activities ->
    // Last 15 reactions on the first activity
    println(activities.first().latestReactions)
    // Count of reactions by type
    println(activities.first().reactionGroups)
}
© Getstream.io, Inc. All Rights Reserved.