如何检测拒绝重定向到Facebook TAB应用程序的权限请求对话框的用户 [英] How to Detect a user declining a permissions request dialog that redirects to a Facebook TAB application
问题描述
我发布在Facebook开发论坛上,听到蟋蟀...希望stackoverflow是一个更好的赌注。
I posted this on the Facebook Dev forum and heard crickets...hopefully stackoverflow is a better bet.
这个问题是关于请求权限对话框从专门针对Facebook应用程序选项卡(不是画布应用程序)。
This question is regarding the request permissions dialog being spawned from within a Facebook Application Tab specifically (not a canvas application).
如果用户点击允许或不允许,则用户将被重定向到与redirect_uri参数中指定的相同的URL。
If a user clicks "Allow", or "Don't Allow" the user is redirected to the same URL as specified in the redirect_uri parameter.
如果画布应用程序的情况下,我可以使用URL中传递的错误信息来区分接受或拒绝权限请求的用户。
If the case of a canvas application I can use the error information that is passed in the URL to distinguish between the user who has accepted or declined the permissions request.
但是,如果重定向URI指定了Page TAB应用程序(而不是画布应用程序),则无法将此信息传递到iframe中 - 只能通过是通过签名请求参数的app_data参数。 (我可以使用redirect_uri设置app_data参数,但是由于这是相同的,如果用户接受或拒绝权限对话框,它没有帮助)
However, if the redirect URI specifies an Page TAB Application (and not a canvas app) I cannot pass this information into the iframe -- the only thing that gets passed through is the app_data parameter through the signed request parameter. (I can set the app_data parameter with the redirect_uri but since this is the same if a user accepts or rejects the permissions dialog, its of no help)
如果有人可以让我知道如果一个Tab应用程序可能知道如果用户在请求权限对话框中单击不允许(或有任何其他建议),我将非常感谢!
If anyone could let me know if its possible for a Tab Application to "know" if a user clicks "Don't Allow" within a request permissions dialog (or has any other suggestion) I would be very grateful!
非常感谢
推荐答案
我不认为你可以在Facebook标签中做你所需要的登录网址。你是否考虑过使用JavaScript SDK?
I don't think you can do what you require within a Facebook tab using a login url. Have you considered using the JavaScript SDK instead?
FB.login(
function(response) {
if (response.session) {
if (response.perms) {
// user is logged in and granted permissions
} else {
// user is logged in, but did not grant any permissions
}
} else {
// user is not logged in
}
}, {perms:'list,of,permissions'} // if required eg {perms:'publish_stream, email'}
);
这篇关于如何检测拒绝重定向到Facebook TAB应用程序的权限请求对话框的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!