简体   繁体   English

Graph API PHP SDK-如何获取FB.streampublish样式框

[英]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. 我正在尝试使用Facebook的新图形API示例获取一个streampublish框。 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.... 您是否正确初始化或调用了Fb脚本?

It goes something like 它像

FB.init("API Key", "xd_receiver.htm"); FB.init(“ API密钥”,“ 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 }); window.fbAsyncInit = function(){FB.init({appId:'getAppId();?>',session:,//当PHP已经具有会话状态时,不重新获取会话状态:true,//检查登录状态cookie :true,//启用cookie以允许服务器访问会话xfbml:true //解析XFBML}); // whenever the user logs in, we refresh the page FB.Event.subscribe('auth.login', function() { window.location.reload(); }); //每当用户登录时,我们都会刷新页面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); }()); (function(){var e = document.createElement('script'); e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js'; e.async = true;文档.getElementById('fb-root')。appendChild(e);}());

i dont actually remember the proper link to this in facebook 我实际上不记得在Facebook中对此的正确链接

but i think u need to connect and call the FBJS properly to get this right!!! 但我认为您需要正确连接并调用FBJS才能实现此目的!!!

may be this wou;d help!!! 可能对您有帮助!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM