IOS Swift and Facebook SDK

后端 未结 2 936
攒了一身酷
攒了一身酷 2020-12-21 14:08

Let me apologize first, just learning swift, so I am not 100% on what I am doing. I have found many tutorials on integrating a facebook login in swift and have what appears

相关标签:
2条回答
  • 2020-12-21 14:48

    Facebook as changed SDk. Please find the latest solution here

    http://www.brianjcoleman.com/tutorial-how-to-use-login-in-facebook-sdk-4-0-for-swift/

    0 讨论(0)
  • 2020-12-21 14:50

    I would like to suggest you the cheking of these steps: -in your VC class, import FacebookSDK statement and FBLoginViewDelegate ? - your outlet should be:

    //FB outlet
    @IBOutlet var fbLoginView: FBLoginView
    

    - in your AppDelegate.swift, also imported the FacebookSDK ? - you have a func in a func in your AppDelegate.swift.It should be:

    import FacebookSDK
    

    @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    
    
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
    
        //FB implementation
        FBLoginView.self
        FBProfilePictureView.self
    
    
        return true
    }
    
    //FB Method handles what happens after authentication
    func application (application:UIApplication, openURL url:NSURL, sourceApplication:NSString?, annotation:AnyObject) -> Bool {
        //test var
        var wasHandled:Bool = FBAppCall.handleOpenURL(url, sourceApplication: sourceApplication)
    // attempt to extract a token from the url
    return wasHandled
    
    }
    
    0 讨论(0)
提交回复
热议问题