Graph API PHP SDK - How to get FB.streampublish style box
I am trying to get a streampublish box with facebook's new graph api example. I am using this code but its not working. Any help guys!
<script>
FB.ui(
{
method: 'stream.publish',
message: 'getting educated about Facebook Connect',
attachment: {
name: 'Connect',
caption: 'The开发者_运维技巧 Facebook Connect JavaScript SDK',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
href: 'http://github.com/facebook/connect-js'
},
action_links: [
{ text: 'Code', href: 'http://github.com/facebook/connect-js' }
],
user_message_prompt: 'Share your thoughts about Connect'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
</script>
Did you intialized or called the Fb scripts properly....
It goes something like
FB.init("API Key", "xd_receiver.htm"); window.fbAsyncInit = function() { FB.init({ appId : 'getAppId(); ?>', session : , // don't refetch the session when PHP already has it status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); // whenever the user logs in, we refresh the page FB.Event.subscribe('auth.login', function() { window.location.reload(); }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }());
i dont actually remember the proper link to this in facebook
but i think u need to connect and call the FBJS properly to get this right!!!
may be this wou;d help!!!
精彩评论