2012-05-22 47 views
6

Facebook Developer在线文档中有测试用户的文档,但是如何删除应用程序不再显示在其应用程序列表中的实际用户?这是与access_tokenfacebook_user_id的知识。有没有办法为你的Facebook应用程序删除用户?

用于删除测试用户:

https://graph.facebook.com/893450345999?method=delete&access_token=A2ADI1YMySweBABBGrWPNwKMlubZA5ZCrQbxwhtlEd9FIQUrOVjsGD3mnIWEbUhzDz7dkuBekMFdHvjvJ9CZAU7EMSSaZBsgN60FkMCi3AAZDZD 

运行测试用户链路产生以下错误:

"error": { 
     "message": "(#100) Can only call this method on valid test users for your app", 
     "type": "OAuthException", 
     "code": 100 
    } 

回答

10

您寻求申请DE-授权:

You can de-authorize an application or revoke a specific extended permissions on behalf of a user by issuing an HTTP DELETE request to PROFILE_ID/permissions with a user access_token for that app.

permission - The permission you wish to revoke. If you don't specify a permission then this will de-authorize the application completely.

为了实现这一问题的要求:

https://graph.facebook.com/me/permissions?method=delete&access_token=... 

一旦申请撤销核准,将不会出现在用户的应用程序列表。

+0

有没有办法为所有用户做到这一点,而不删除应用程序本身? – alybadawy

+0

如果我有很多权限,是否需要遍历所有这些内容,并删除所有这些权限,以便我的应用不再出现? – ihue

4

实际用户的“删除”自己从你的应用程序时,他们从您的应用其帐户,你不必做任何事情。

如果您想知道用户何时取消您的应用授权,可以在您的应用设置中指定取消授权回拨URL。截至https://developers.facebook.com/docs/authentication/在文档中描述:

Upon app removal we will send an HTTP POST request containing a single parameter, signed_request, which, once decoded, will yield a JSON object containing the user_id of the user who just deauthorized your app. You will not receive an user access token in this request and all existing user access tokens that were previously issued on behalf of that user will become invalid.

UPDATE:要从用户的授权的应用程序中删除自己的应用程序,发出一个HTTP DELETE来https://graph.facebook.com/[userid]/permissions?access_token=...https://developers.facebook.com/docs/reference/api/user/

通常,图形API调用还支持使用额外参数method=DELETE执行HTTP POST,以防DELETE调用不可用/不受支持。

+0

我希望能够允许用户从我的网站中删除应用程序。如果您已经使用了pinterest,您会在用户的编辑用户设置页面上看到,他们可以在其网站上链接/取消链接他们的Facebook应用,而不是在facebook.com上。这完全从用户安装的Facebook应用程序列表中删除了pinterest应用程序。 – Goalie

+0

我明白你的意思了。我相应地更新了我的答案。 – chesles

相关问题