Dhr*_*hak 6 javascript php facebook facebook-graph-api
我的应用程序位于Facebook画布外.Facebook请求对话框2.0仅重定向到画布URL,例如.apps.ibibo.com/YOURAPP.如何让它打开自定义网址?这可以在传统的FBML表单中使用fb:request-form和设置req-url.
请求2.0仅限于Facebook内部URL吗?我的要求是发送游戏请求,但我的游戏位于Facebook外面.即点击"接受"时,应该打开网址
" http://www.mydomain.com/mygame "而不是
" http://apps.facebook.com/mygame ".

这些方法似乎不符合我的要求:http: //developers.facebook.com/docs/reference/dialogs/requests/ (只有canvas url重定向)
我想到了一个解决方法:用户单击"接受"并进入画布URL,并从画布URL,我将他重定向到我在facebook外面的URL.但我不确定这是否符合Facebook政策?(在第一段第4点提到:http://developers.facebook.com/blog/)
需要一个jquery脚本来覆盖facebook的默认功能.但是,只有当用户访问"http://apps.facebook.com/mygame"并点击"添加应用"时,此功能才有效.
更简单的是只有一个欢迎页面,用户点击"播放",它会在你的页面中打开一个新窗口.
阅读更多:http://developers.facebook.com/blog/post/525/ - 祝你好运!
把它<button id="fb-auth">Login</button>放在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);
Run Code Online (Sandbox Code Playgroud)