如何使用Android SDK撤销所有Facebook权限? [英] How to revoke all Facebook permissions using Android SDK?

查看:158
本文介绍了如何使用Android SDK撤销所有Facebook权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的应用中有一个我想撤销所有权限的情况。根据Facebook文档,您可以使用AsyncFacebookRunner来执行此操作,如果您没有指定权限,那么这将完全取消授权应用程序。



我目前正在这样做:

  String method =DELETE; 
Bundle params = new Bundle();
params.putString(permission,);

mAsyncRunner.request(/ me / permissions,params,method,new RequestListener()
{...},null);

使用这样的请求签名:

  void request(String graphPath,Bundle parameters,final String httpMethod,
RequestListener listener,final Object state)

onComplete()回调函数似乎恢复正常,但似乎没有取消授权访问令牌。我推断这是因为下一次我打给Facebook.authorize(),它的作品没有推送用户到Facebook登录页面。



任何想法,我需要更改完全取消授权访问令牌?还是有不同的/更好的方式来做到这一点?非常感谢!

解决方案

从这篇文章显示: Facebook取消授权我的应用程序和其他人,无法以编程方式取消授权应用程序。不幸的是,上面的调用成功地返回到onCreate(),但对用户的应用程序没有任何解释/删除。



底线:看起来像唯一的方法一个应用程序是用户直接在Facebook上进行的。如果有什么不一样的话,请说出来 - 但是不要浪费你的时间!谢谢。


I'm having a problem revoking Facebook permissions using the Android SDK.

There's a case in my app where I want to revoke all permissions. According to the Facebook documentation, you can use AsyncFacebookRunner to do this, and "if you don't specify a permission then this will de-authorize the application completely."

I'm currently doing it like this:

String method = "DELETE";
Bundle params = new Bundle();
params.putString("permission", "");

mAsyncRunner.request("/me/permissions", params, method, new RequestListener()
                     { ... }, null);

using the request signature like this:

void request(String graphPath, Bundle parameters, final String httpMethod,
             RequestListener listener, final Object state)

The onComplete() callback function seems to come back OK, but doesn't appear to have de-authorized the access token. I'm inferring this because the next time I call facebook.authorize(), it works without pushing the user to the Facebook login page.

Any ideas what I need to change to completely de-authorize an access token? Or is there a different/better way to do this? Many thanks!

解决方案

It appears from this post: Facebook deauthorize my app and others that it's not possible to deauthorize an application programmatically. Unfortunately, the call above returns successfully to onCreate() but does nothing to deauth/delete the app for the user.

Bottom line: It looks like the only way to deauth an app is for the user to do it directly in Facebook. If anyone knows differently, please say so - but otherwise, don't waste your time trying! Thanks.

这篇关于如何使用Android SDK撤销所有Facebook权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆