This project is read-only.

minifeed working sample after recent release?

Jan 27, 2008 at 7:21 PM
Hi,

My minifeed and newsfeed were working fine before the last recent. I am aware of the new changes of the feeds but does anyone have a working example of how to use it?

My previous setup is now Obsolete and I need to move it to the new construction. But I have trouble getting it to work, any suggestion? thanks!

Tak111
Jan 27, 2008 at 8:31 PM
Use BuildProfileFbml as normal.

OnSendGreetingClick should be the same as well.

For your minifeed/newsfeed publish use service.Feed.PublishMiniFeedStory(story); // (I believe that is also the same)

Then for the profile page update...
service.Profile.SetFbml(profileFbml, service.UserID); // old implementation - deprecated
//service.Profile.SetFbml(service.UserID, profileFbml, ""); // "" actionFbml new implementation

I wasn't able to get the newsfeed to publish until I added the application under the user account I was sending to.

I still have everything running in developer mode because I want things rock solid before anyone adds it. I also had to add my test user to the developer list. Once I did that the newsfeeds started showing up for them - before that they did not.

I'd like to get the newsfeed action to work even if the recipient doesn't have the app installed (like most apps do), but I haven't been able to get that working as of yet.
Feb 18, 2008 at 10:27 PM

tak111 wrote:
My minifeed and newsfeed were working fine before the last recent. I am aware of the new changes of the feeds but does anyone have a working example of how to use it?


Go to the Develop application, click on the "See My Apps" link, and then click on the Feed Templates link for your application. Then register a new template and there's an option to change the Audience of your feed stories. Also, there's a lot of rumbling on the Facebook Developer Forum about how templatized feed stories aren't always showing up in the News Feed--the consensus that I've seen is that there's some Facebook magic that determines whether a story will appear in the News Feed. It's not automatic like it used to be.

As for the actual code, this definitely works in the Mini-Feed:

FacebookService fb = new FacebookService(AppKey, AppSecret, FacebookUser.Id, FacebookUserInfiniteSessionKey, null);
FeedStoryTemplate fst = new FeedStoryTemplate("{actor} did something to {target} on {actionDate}");
FeedStory feedStory = new FeedStory(fst, component.FacebookUserId.ToString());
feedStory.AddTemplateValue("actionDate", component.ActionDate);
fb.Feed.PublishMiniFeedStory(feedStory);

And then you just keep adding AddTemplateValue calls for each token you've got in your FeedStoryTemplate.
Feb 19, 2008 at 9:33 PM
Thanks for the replies guys. I will give it a try!@ !
Mar 1, 2008 at 12:51 AM

wcbrown wrote:

tak111 wrote:
My minifeed and newsfeed were working fine before the last recent. I am aware of the new changes of the feeds but does anyone have a working example of how to use it?


Go to the Develop application, click on the "See My Apps" link, and then click on the Feed Templates link for your application. Then register a new template and there's an option to change the Audience of your feed stories. Also, there's a lot of rumbling on the Facebook Developer Forum about how templatized feed stories aren't always showing up in the News Feed--the consensus that I've seen is that there's some Facebook magic that determines whether a story will appear in the News Feed. It's not automatic like it used to be.

As for the actual code, this definitely works in the Mini-Feed:

FacebookService fb = new FacebookService(AppKey, AppSecret, FacebookUser.Id, FacebookUserInfiniteSessionKey, null);
FeedStoryTemplate fst = new FeedStoryTemplate("{actor} did something to {target} on {actionDate}");
FeedStory feedStory = new FeedStory(fst, component.FacebookUserId.ToString());
feedStory.AddTemplateValue("actionDate", component.ActionDate);
fb.Feed.PublishMiniFeedStory(feedStory);

And then you just keep adding AddTemplateValue calls for each token you've got in your FeedStoryTemplate.


Question, how did you get this to work without setting the target_ids?
Mar 3, 2008 at 11:03 PM

Sirey4 wrote:
Question, how did you get this to work without setting the target_ids?


Good catch. I was obfuscating some of my existing code while simultaneously altering it to match his situation and I botched it. You would need to specify the target IDs because otherwise Facebook would have no idea who was the target of a particular action.

Bill