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

Comments

Overview

Comments support voting, ranking, threading, images, URL previews, mentions and notifications.

Adding Comments

var response = await _feedsV3Client.AddCommentAsync(
    new AddCommentRequest
    {
        Comment = "This is a test comment from .NET SDK",
        ObjectID = activityId,
        ObjectType = "activity",
        UserID = _testUserId
    }
);

Updating Comments

var response = await _feedsV3Client.AddCommentAsync(
    new AddCommentRequest
    {
        Comment = "This is a test comment from .NET SDK",
        ObjectID = activityId,
        ObjectType = "activity",
        UserID = _testUserId
    }
);

Removing Comments

var response = await _feedsV3Client.UpdateCommentAsync(
    commentId,
    new UpdateCommentRequest
    {
        Comment = "Updated comment text from .NET SDK"
    }
);

Reading Comments

You’ll also want to show/return these comments. The most important is when reading the feed.

var response = await _feedsV3Client.DeleteCommentAsync(
    commentId,
    new { user_id = _testUserId }
);

Querying Comments

You can also query the comments so you can show all comments for a given activity or user:

var response = await _feedsV3Client.QueryCommentsAsync(
    new QueryCommentsRequest
    {
        Filter = new Dictionary<string, object> { ["object_id"] = activityId },
        Limit = 10
    }
);

Comment Reactions

var response = await _feedsV3Client.QueryCommentsAsync(
    new QueryCommentsRequest
    {
        Filter = new Dictionary<string, object> { ["object_id"] = activityId },
        Limit = 10
    }
);

Comment Threading

var response = await _feedsV3Client.DeleteCommentAsync(
    commentId,
    new { user_id = _testUserId }
);
© Getstream.io, Inc. All Rights Reserved.