I've updated Facebook SDK to the latest version with cocoapods:
When Facebook app is installed, LoginManager()
callback is not called. When the app is not installed and the browser is used, it works.
let loginManager = LoginManager()
loginManager.logIn(permissions: [.publicProfile, .email], viewController: self, completion: { loginResult in
switch loginResult {
case .failed(let error):
print("\(error)")
case .cancelled:
print("cancelled")
case .success(let grantedPermissions, let declinedPermissions, let accessToken):
print("\(grantedPermissions) \(declinedPermissions)")
}
})
Any idea?
Updating to the new SDK solved:
pod 'FBSDKCoreKit/Swift'
pod 'FBSDKLoginKit/Swift'