How can I use stream.publish with @ tags using the Facebook API?
I have a page, and I want to make a little competition. I'm using a static FBML tab and after users clicks on some choices they have to publish some text on their walls in order to enter the competition.
Everything is working great, but now I have a problem. I want to know how exactly to publish that text on their walls. I tried to search for something in FBML, FBJS or FQL that can send me the user ID to my server via Ajax and I can store that in my database, but for privacy purposes that is forbidden in pages.
Now I'm trying to tag my page's name (@mypagename) in stream.publish
so users' posts will appear on my wall so I can track them and choose a winner from them, but I couldn't also do the tag thing.
How开发者_如何转开发 do I fix the @tag
thing?
My publish code:
<script type="text/javascript">
var attachment;//some data here
Facebook.streamPublish('message here', attachment);
</script
You might need to use the FB.ui helper method:
function feed_via_ui() {
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: 'http://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
message: 'Facebook Dialogs are easy!',
to:'12334556' //UID
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
}
精彩评论