你可以在数据参数中放一个url
在底部的属性下查看http://developers.facebook.com/docs/reference/dialogs/requests/。
data 可选的,您可以传递用于跟踪的附加数据。这将
存储为创建的请求对象的一部分。
这将被传回给您,您可以使用 javascript 来 location.href 到数据中的 url。
---------这是我过去使用的示例
var thisimg = 'AN_IMG';
var thisurl = 'A_URL';
window.sendrequest = function(){
FB.ui({ method: 'apprequests',
title: 'A request.',
message: 'Rate Me! Request from: ' +thisname+' ',
data: ''+thisimg+' '+thisurl+' ',
filters: ['all'],
});
}
--------- 来自 Facebook 的示例,添加了数据参数。
var thisimg = 'AN_IMG';
var thisurl = 'A_URL';
function sendRequestToManyRecipients() {
FB.ui({method: 'apprequests',
message: 'My Great Request',
data: ''+thisimg+' '+thisurl+' ',
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
在回调时,您可以执行 window.top.location.href='';使用您传入数据的 url。
注意:请求的默认重定向是画布,这是无法更改的。用户登陆您的画布后,您将从请求中读取数据参数并将它们重定向到您的外部应用程序。
“我没有看到任何其他方法可以做到这一点,因为 requests2.0 不包含重定向 uri 的选项。”