TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Fahid Attique.
Depends on: | |
FBSDKCoreKit | >= 0 |
FBSDKLoginKit | >= 0 |
Appdelegate.swift
file,
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
}
@available(iOS 9.0, *)
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
}
fileprivate let facebookManager = FacebookManager()
facebookManager.tryAuthenticate(fromViewController: self, success:{ facebookToken in
self.getProfileIfNeeded()
}) { error in
print("Error: \(String(describing: error?.localizedDescription))")
}
private func getProfileIfNeeded(){
facebookManager.fetchLoggedUserInfo(successBlock: { (userInfo) in
print("\(String(describing: userInfo))")
}) { (error) in
print("Error: \(String(describing: error?.localizedDescription))")
}
}
NBFacebookManager is available under the MIT license. See the LICENSE file for more info.
Fahid Attique - (https://github.com/fahidattique55)