Closed marcellofiore closed 5 years ago
I'd recommend moving your AKFViewControllerDelegate conformance to a separate file due to the collision between the AccessToken types:
// ViewController+AccountKit.swift
import AccountKit
extension ViewController: AKViewControllerDelegate {
func viewController(_ viewController: UIViewController & AKFViewController, didCompleteLoginWith accessToken: AccessToken, state: String) {
...
}
}
Then, remove import AccountKit
from your current file.
I have the same issue and that solution doesn't work for me. Any others solutions ? @robtimp what did you do ? @marcellofiore
Use FBSDKCoreKit.AccessToken
func viewController(viewController: UIViewController!, didCompleteLoginWithAccessToken accessToken: FBSDKCoreKit.AccessToken!, state: String!) {
print("did complete login with access token \(accessToken.tokenString) state \(state)")
}
Use FBSDKCoreKit.AccessToken
func viewController(viewController: UIViewController!, didCompleteLoginWithAccessToken accessToken: FBSDKCoreKit.AccessToken!, state: String!) { print("did complete login with access token \(accessToken.tokenString) state \(state)") }
Instance method 'viewController(:didCompleteLoginWith:state:)' nearly matches optional requirement 'viewController(:didCompleteLoginWith:state:)' of protocol 'AKFViewControllerDelegate'
I think this issue here may be that this doesn't match the new method signature for this protocol, which is func viewController(_ viewController: UIViewController & AKFViewController, didCompleteLoginWith accessToken: AccessToken, state: String)
After updating the sdk, I have this error => ('AccessToken' is ambiguous for type lookup in this context) on method => func viewController(viewController: UIViewController!, didCompleteLoginWithAccessToken accessToken: AccessToken!, state: String!)
I want to clarify that: I use it in the same ViewController FBSDKCoreKit and FBSDKLoginKit for facebook Login, if I remove import FBSDKCoreKit and import FBSDKLoginKit the problem is solved.
Can anyone help me?