Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementation of application:openURL:sourceApplication:annotation

I started working on the app before the release of Xcode8 and and then switched over , When I try to log into the app using Facebook login I get the following error

Implementation of application:openURL:sourceApplication:annotation: not found. Please add the handler into your App Delegate. Class: GhostGab.AppDelegate

I checked all the settings and they seemed fine . Any help will be appreciated

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    FIRApp.configure()
    FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    return true
}

  func application(application: UIApplication, openURL url: URL, sourceApplication: String?, annotation: AnyObject) -> Bool {

    let facebookDidHandle = FBSDKApplicationDelegate.sharedInstance().application(
        application,
        open: url,
        sourceApplication: sourceApplication,
        annotation: annotation)
    // Add any custom logic here.
    return facebookDidHandle
}
like image 911
Sruthin Gaddam Avatar asked Jun 15 '26 07:06

Sruthin Gaddam


1 Answers

Your function definition:

func application(application: UIApplication, openURL url: URL, sourceApplication: String?, annotation: AnyObject) -> Bool {
}

Should be replaced by:

func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
}

There's an underscore for the first parameter and Any in place of AnyObject for the last parameter type.

That's why you're getting the error:

Implementation of application:openURL:sourceApplication:annotation

like image 91
Rajan Maheshwari Avatar answered Jun 17 '26 23:06

Rajan Maheshwari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!