最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Facebook requests 2.0 , how to change "Accept" button url to be a url outside of facebook? - Stack Overf

programmeradmin4浏览0评论

My app sits outside facebook canvas. The facebook request dialog 2.0 only redirects to canvas url eg. apps.ibibo/YOURAPP. How can I make it open a custom url ? This was possible in legacy FBML form with fb:request-form and setting req-url .

Are requests 2.0 restricted only to inside facebook URLS ? My requirement is to send game requests,but my game sits outside facebook. i.e. on clicking "ACCEPT" the url to open should be

"" and not

"" .

These methods do not seem to fit my requirement : / ( only canvas url redirection )

I thought of one workaround as : The user clicks on "ACCEPT" and es to the canvas url, and from the canvas url, I redirect him to my url outside facebook. But I am not sure if that is pliant with facebook policy ? ( mentioned here in point#4 of first paragraph : / )

My app sits outside facebook canvas. The facebook request dialog 2.0 only redirects to canvas url eg. apps.ibibo./YOURAPP. How can I make it open a custom url ? This was possible in legacy FBML form with fb:request-form and setting req-url .

Are requests 2.0 restricted only to inside facebook URLS ? My requirement is to send game requests,but my game sits outside facebook. i.e. on clicking "ACCEPT" the url to open should be

"http://www.mydomain./mygame" and not

"http://apps.facebook./mygame" .

These methods do not seem to fit my requirement : http://developers.facebook./docs/reference/dialogs/requests/ ( only canvas url redirection )

I thought of one workaround as : The user clicks on "ACCEPT" and es to the canvas url, and from the canvas url, I redirect him to my url outside facebook. But I am not sure if that is pliant with facebook policy ? ( mentioned here in point#4 of first paragraph : http://developers.facebook./blog/ )

Share Improve this question edited Nov 2, 2011 at 16:27 DhruvPathak asked Oct 25, 2011 at 7:42 DhruvPathakDhruvPathak 43.3k17 gold badges124 silver badges179 bronze badges 2
  • please read the ments in the answer for the following question stackoverflow./questions/7914296/… – bool.dev Commented Nov 2, 2011 at 8:14
  • @Igy in the ments, in the question mentioned above is a credible source, please check :) – bool.dev Commented Nov 2, 2011 at 13:41
Add a ment  | 

2 Answers 2

Reset to default 5

Need a jquery script to override the default function of facebook. However this works only when the person goes to "http://apps.facebook./mygame" and click on 'add app'.

Simpler to just have a wele page, users click on "PLAY" and it opens a new window into your page.

Read more: http://developers.facebook./blog/post/525/ - good luck coding!

Put <button id="fb-auth">Login</button> somewhere on mygame page and add this javascript code:

function updateButton(response) {
  //Log.info('Updating Button', response);
  var button = document.getElementById('fb-auth');

  if (response.status === 'connected') {
      //button.innerHTML = 'Logout';
      button.onclick = function() {
        FB.logout(function(response) {
          //Log.info('FB.logout callback', response);
        });
      };
    } else {
      //button.innerHTML = 'Login';
      button.onclick = function() {
        FB.login(function(response) {
          //Log.info('FB.login callback', response);
          if (response.status === 'connected') {
            //Log.info('User is logged in');
            window.open("http://xxxxxxxxxxxxxxxx/some.html");
          } else {
            //Log.info('User is logged out');
          }
        });
      };
    }
};

// run it once with the current status and also whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);

Unfortunately the accept button right now will always take you to the application page as you are seeing and there is no way right now to have it go elsewhere. You would have to redirect them from the canvas page. However, I don't see this as being against the Facebook policy though as Facebook requests can be originally sent from outside of Facebook using the iframe plugin. If you wanted to be able to put in an outside url for the accept button, I would log a feature request with Facebook.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论