0

I'm using iOS SDK from facebook website https://developers.facebook.com/docs/ios , but when I add FBSDKApplicationDelegate into App delegate I receive an error

Multiple inheritance from classes 'UIApplication' and 'FBSDKApplicationDelegate'.

I can't use Swift SDK, because my project is on XCode 8.2.1, Swift SDK for Facebook requires 8.3

Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79

1 Answers1

1

Seem like you are using FBSDKApplicationDelegate by this way or something like this

class AppDelegate: UIResponder, UIApplicationDelegate, FBSDKApplicationDelegate

Please take a look at FBSDKApplicationDelegate carefully.

Discussion: The methods in this class are designed to mirror those in UIApplicationDelegate, and you should call them in the respective methods in your AppDelegate implementation.

It isn't used that way. Don't make AppDelegate inheritance from FBSDKApplicationDelegate. Let use FBSDKApplicationDelegate's methods inside AppDelegate's methods

You can learn how to use FBSDKApplicationDelegate by following answer in this question Integration new facebook SDK by swift

func applicationDidBecomeActive(application: UIApplication!) {
    FBSDKAppEvents.activateApp()
}

func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
    return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String, annotation: AnyObject?) -> Bool {
    return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}

For more detail and easy understanding, i create a demo project with Facebook iOS SDK IntegrateFBSDK. You can try it.

trungduc
  • 11,926
  • 4
  • 31
  • 55