1

I'm trying to figure out how to redirect users to a different page in a Page Tab Application similar to this one

4

1 回答 1

0

您可以使用Feed Dialog并设置redirect_uri参数 – The URL to redirect to after the user clicks a button on the dialog.

使用以下 Javascript 代码,您可以做到这一点:

    FB.init({appId: "YOUR_APP_ID", status: true, cookie: true});

    function postToFeed() {

      // calling the API ...
      var obj = {
        method: 'feed',
        link: 'URL_TO_SHARE',
        picture: 'SHARING_PICTURE',
        name: 'SHARING_TITLE',
        caption: 'SHARING_CAPTION',
        description: 'SHARING_DESCRIPTION',
        redirect_uri: 'URL_TO_REDIRECT_AFTER_ACTION'
      };

      function callback(response) {
        // Some callback action ...
      }

      FB.ui(obj, callback);
    }

然后将postToFeed函数绑定到按钮或链接的单击事件。

于 2012-07-02T15:35:16.360 回答