开发者

Cannot get an embedded dialog to show up in facebook javascript sdk

开发者 https://www.devze.com 2023-01-03 03:10 出处:网络
I\'m using the default stream.publish example in an iframed facebook app with the new SDK. My problem is that the stream.publish always shows up in a popup window instead of an on page dialog. Does a

I'm using the default stream.publish example in an iframed facebook app with the new SDK.

My problem is that the stream.publish always shows up in a popup window instead of an on page dialog. Does anyone know how to get this old behavior back?

   
 $(document).ready(function(){
     $("#streampublish").click(function() {
     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.');
     开发者_StackOverflow中文版    } else {
           alert('Post was not published.');
         }
       }
     );
    }
    }


FB.ui({method: 'apprequests',access_token:'Valid Access Token',display:'iframe',
 message: 'You should learn more about this awesome game.', title: 'APP NAME'},
                function(response) {
                     if(response && response.request_ids){
                         alert(response.request_ids);
                     }   
                }
);

Add display:'iframe' in your code as shown above and pass a valid access token.

Reference: http://developers.facebook.com/docs/reference/dialogs/

0

精彩评论

暂无评论...
验证码 换一张
取 消