I have a problem with FBSDKLoginManagerRequestTokenHandler as it should be invoked, but it is not.
let login = FBSDKLoginManager()
login.logInWithReadPermissions(["email"]) { (result, error) in
// should be retuned here after dismissing Safari, as I understood, but app never call this block.
}
It works perfect at the first step, so app open safari and I able to login on Facebook.
It says "App is already authorized" and I tapped on Ok button on Safari and then I see an alert which says "Open this page in my app", I tap open and nothing happen. I mean there is no call back in return.
Details:
iPhone 6 plus with iOS 9.2.1
pod 'Facebook-iOS-SDK', '~>4.1'
Alos as I noticed I have this error in my log:
-canOpenURL: failed for URL: "fbauth://authorize/?client_id=1150389881653102&default_audience=friends&display=touch&e2e=%7B%22init%22%3A1459873693399%7D&legacy_override=v2.3&redirect_uri=fbconnect%3A%2F%2Fsuccess&response_type=token%2Csigned_request&return_scopes=true&scope=email&sdk=ios&sdk_version=4.1.0&state=%7B%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A0%2C%220_auth_logger_id%22%3A%228FB19521-A8ED-49DA-A7DC-E5382029252C%22%7D" - error: "This app is not allowed to query for scheme fbauth"
Adding data to plist does not help as suggested here. I've added this:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
I have this in app delegate:
public func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool
{
return self.applicationManager.application?(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation) ?? false
}
but see it's deprecated in iOS 9