Facebook用对话框发布流

时间:2014-09-11 10:09:14

标签: ruby-on-rails ruby facebook facebook-graph-api publish

我的代码在这里

<!--<script type="text/javascript" src="https://socialapps_public.s3.amazonaws.com/fb.js"></script>-->
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
function fb_publish() {
     FB.ui(
       {
         app_id: 'myapp id'
         method: 'stream.publish',
         message: 'Message here.',
         attachment: {
           name: 'Name here',
           caption: 'Caption here.',
           description: (
             'description here'
           ),
           href: 'http://dev.librify.com/books/160001-blue-guide-concise-italy-blue-guides#_=_'
         },
         action_links: [
           { text: 'Code', href: 'http://dev.librify.com/books/160001-blue-guide-concise-italy-blue-guides#_=_' }
         ],
         user_prompt_message: 'Personal message here'
       },
       function(response) {
         if (response && response.post_id) {
           alert('Post was published.');
         } else {
           alert('Post was not published.');
         }
       }
     );  
  }
</script>
<div id="fb-root"></div>
<a href="" onclick="share_friends(); return false;">share</a>

但它会将我们作为附件enter image description here

0 个答案:

没有答案