How to revoke all Facebook permissions using Android SDK?

后端 未结 4 462
小蘑菇
小蘑菇 2021-01-20 05:12

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 Facebo

4条回答
  •  旧时难觅i
    2021-01-20 05:38

    You can delete the entire application (not only permissions) from users Facebook account using latest SDK (mine is 4.1.1)

    void deleteFacebookApplication(){
        new GraphRequest(AccessToken.getCurrentAccessToken(), "/me/permissions", null, HttpMethod.DELETE, new GraphRequest.Callback() {
            @Override
            public void onCompleted(GraphResponse response) {
                boolean isSuccess = false;
                try {
                    isSuccess = response.getJSONObject().getBoolean("success");
                } catch (JSONException e) {
                    e.printStackTrace();
                }
                if (isSuccess && response.getError()==null){
                    // Application deleted from Facebook account
                }
    
            }
        }).executeAsync();
    }
    

提交回复
热议问题