Facebook请求2.0,如何更改“接受”按钮 url 是 Facebook 之外的 url?

发布于 2024-12-11 21:44:03 字数 1037 浏览 0 评论 0原文

我的应用程序位于 Facebook 画布之外。 facebook 请求对话框 2.0 仅重定向到画布 url 例如。 apps.ibibo.com/YOURAPP。 如何让它打开自定义网址? 这可以在旧版 FBML 表单中使用 fb:request-form 并设置 req-url 实现。

requests 2.0 是否仅限于 Facebook 内部 URL? 我的要求是发送游戏请求,但我的游戏位于 Facebook 之外。 即点击“接受”后,要打开的网址应为

http://www.mydomain.com/mygame”而不是

http://apps.facebook.com/mygame”。

在此处输入图像描述

这些方法似乎不符合我的要求: http://developers.facebook.com/docs/reference/dialogs/requests/< /a> (仅画布网址重定向)

我想到了一种解决方法: 用户点击“接受”并来到画布网址,我从画布网址将他重定向到我在 facebook 之外的网址。但我不确定这是否符合 Facebook 政策? (在第一段的第 4 点中提到:http://developers.facebook.com/blog/)

My app sits outside facebook canvas.
The facebook request dialog 2.0 only redirects to canvas url
eg. apps.ibibo.com/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.com/mygame" and not

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

enter image description here

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

I thought of one workaround as :
The user clicks on "ACCEPT" and comes 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 compliant with facebook policy ? ( mentioned here in point#4 of first paragraph : http://developers.facebook.com/blog/ )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

回忆凄美了谁 2024-12-18 21:44:03

需要一个jquery脚本来覆盖facebook的默认功能。然而,这仅当用户访问“http://apps.facebook.com/mygame”并单击“添加应用程序”时才有效。

更简单的是,只有一个欢迎页面,用户单击“播放”,它会在您的页面中打开一个新窗口。

了解更多:http://developers.facebook.com/blog/post/525/ - 祝你编码顺利!

放在 mygame 页面上的某处并添加以下 javascript 代码:

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);

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

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

Read more: http://developers.facebook.com/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);
陌伤ぢ 2024-12-18 21:44:03

不幸的是,现在的接受按钮总是会将您带到您所看到的应用程序页面,并且现在无法将其转到其他地方。您必须从画布页面重定向它们。不过,我并不认为这违反了 Facebook 政策,因为 Facebook 请求最初可以使用 iframe 插件从 Facebook 外部发送。如果您希望能够为接受按钮输入外部网址,我会记录功能请求与脸书。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文