1

I have a requirement where the logged in user should be able to view all chatter posts which are having an @ mention to him. I need the exact chatter post to be shown as the user want to comment on the chatter post. Is there any way to do this by using chatter connect API. Any help is appreciated.

1

The following article helped me to display these chatter feeds .

http://developer.force.com/cookbook/recipe/connect-in-apex-pilot

Please make sure you keep the version of your classes to 28.There is a small bug here with version 29 and i am still working to fix this.

global class DemoController {

// get first page of news feed
global ConnectApi.FeedItemPage getNewsFeed() {
    return ConnectApi.ChatterFeeds.getFeedItemsFromFeed(null, ConnectApi.FeedType.News, 'me');
}

// build list of wrapped feed items for display in VisualForce
global List<FeedItemInfo> getNewsFeedForDisplay() {
    ConnectApi.FeedItemPage feed = getNewsFeed();      
    List<FeedItemInfo> result = new List<FeedItemInfo>();
    for (ConnectApi.FeedItem item : feed.items) {
        result.add(new FeedItemInfo(item));
    }

    return result;
  }
 }
|improve this answer|||||
  • Can this be used to get all chatter posts having @ mention to to me? – Shebin Mathew Mar 3 '14 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.