We need to give community user ability to like the feed item. Tried below code.
ConnectApi.ChatterFeeds.updateLikeForFeedElement(communityId,feedItemId, true);
Error:
System.NoAccessException: Insufficient Privileges: You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.
This code is working with the standard user but not for the community user. Is there any setting for this?
INSERT new FeedLike (FeedItemId = FeedEntityId);
. FeedLikeYou can like or unlike posts, comments, and other feed item types only after they're published.
INSERT new FeedLike (FeedEntityId= FeedEntityId);