Search code examples
iosobjective-cfacebook-graph-apipermissions

Facebook SDK remove app permissions programmatically


I'am working in an iOS application that requests user Facebook login with a list of permissions.

I can check if the user have declined some of the requested permission by this method
[[[FBSession activeSession] permissions] isEqualToArrayOfStrings:permissions] and remove the session.
But the problem is if the user tried to login again ,The Facebook SDK doesnt request for the permissions again it shows a view says

"you have already authorized XXXXX "

And doest ask the user to accept the permissions he has declined before. Because of this i need revoke or delete the user permissions from his Facebook account to be able to ask for permissions again ;


Solution

  • I found the answer in this link Revoke Login

    [[[FBRequest alloc]initWithSession:[FBSession activeSession] graphPath:@"me/permissions" parameters:nil HTTPMethod:@"delete"] startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
        // Handling 
                     }];