Skip to content

Instantly share code, notes, and snippets.

@codegefluester
Created September 22, 2016 15:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save codegefluester/f797dd723e93e545b855525a4b9ab057 to your computer and use it in GitHub Desktop.
Save codegefluester/f797dd723e93e545b855525a4b9ab057 to your computer and use it in GitHub Desktop.
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
// Override point for customization after application launch.
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(
app,
open: url as URL!,
sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String,
annotation: options[UIApplicationOpenURLOptionsKey.annotation]
)
}
public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(
application,
open: url as URL!,
sourceApplication: sourceApplication,
annotation: annotation)
}
}
@delhiveryakshay
Copy link

Thanks buddy . you are life saver

@nevinjethmalani
Copy link

I am using this with version 4.17 of the FB SDK and getting nil for the token. Any idea on why that might be. If i use this with an older version of the FB SDK (4.15.1), it works perfectly.

@exocode
Copy link

exocode commented Jun 2, 2017

@chmziaurrehman
Copy link

Good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment