简体   繁体   English

如何重置iOS应用中的所有Facebook权限?

[英]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? 我正在为iOS和测试应用程序开发应用程序,我需要清除/重置所有的Facebook权限...怎么能这样做?

if check the permission whit graph path, i see this log 如果检查权限whit图路径,我会看到这个日志

[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" 例如,如果要删除特定权限只需更改路径,这里我要撤消publish__actions权限startWithgraphPath:@"/me/permissions/publish_actions"

Here , is the list with the permission. 是具有权限的列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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