facebook-ios-sdk icon indicating copy to clipboard operation
facebook-ios-sdk copied to clipboard

GraphRequest.start { connection, result, error } doesn't complete after the app is deauthorized from account

Open iandis opened this issue 2 years ago • 0 comments

Checklist before submitting a bug report

Xcode version

15.2

Facebook iOS SDK version

16.3.1

Dependency Manager

CocoaPods

SDK Framework

Login

Goals

I'm trying to get the error from GraphRequest.start { connection, result, error } when the app is deauthorized from a FB account. I tried to do the same on the Android SDK and it worked, this one didn't.

Note: I used the test app instead of the live one

Expected results

The method should complete with error

Actual results

The method doesn't complete until after a few more calls

Steps to reproduce

  1. Login using SDK with any FB account
  2. Call the GraphRequest.start
  3. Go to the FB account's settings -> Apps and websites -> Remove the app
  4. Call the GraphRequest.start again

Code samples & details

// login
loginManager.logIn(permissions: permissions, from: viewController, handler: { result, error in
            if error != nil {
                print("error")
            } else if result!.isCancelled{
                print("canceled")
            } else {
                print("success")
            }
        })

// graph request
GraphRequest(graphPath: "me", parameters: ["fields": fields]).start { connection, result, error  in
            if let result = result as? NSDictionary, error == nil {
                print("success")
            } else {
                print("error")
            }
        }

iandis avatar Jan 23 '24 11:01 iandis