2012-05-22 44 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

相關問題