简体   繁体   中英

How to reset all Facebook Permission in an iOS app?

i'm developing an application for iOS and for test app, i need clear/reset all facebook permission... how can do this?

if check the permission whit graph path, i see this log

[PF_FBRequestConnection startWithGraphPath:@"me/permissions"
                         completionHandler:^(PF_FBRequestConnection *connection, id result, NSError *error) {

                             NSLog(@"facebook_permission: %@",result);


                         }];

the result is

[6412:c07] facebook_permission: {
data =     (
            {
        "create_note" = 1;
        email = 1;
        installed = 1;
        "photo_upload" = 1;
        "publish_actions" = 1;
        "publish_stream" = 1;
        "share_item" = 1;
        "status_update" = 1;
        "user_about_me" = 1;
        "user_birthday" = 1;
        "user_location" = 1;
        "video_upload" = 1;
    }
);

i want to clear all permission.. it's possible?

Yes, it is. Here is an example.

[FBRequestConnection startWithGraphPath:@"/me/permissions"
                     parameters:nil HTTPMethod:@"delete"
                     completionHandler:^(FBRequestConnection *connection, id result,    NSError *error)                                                                               {
                      if (!error && result == true) {
                        // Revoking the permission worked
                        NSLog(@"Permission successfully revoked");
                      } else {
                        // There was an error, handle it
                        NSLog(@"here was an error");
                        // See https://developers.facebook.com/docs/ios/errors/
                      }
}];

For example,if you want to delete an specific permissions just change the path, here i'm revoking the publish__actions permissions startWithgraphPath:@"/me/permissions/publish_actions"

Here , is the list with the permission.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM