swiftfbsdkfbsdkloginkit

SDKApplicationDelegate Use of unresolved identifier


I have two pods installed for facebook login

pod 'FacebookCore'
pod 'FacebookLogin'

than imported FacebookCore in appdelegate. still it shows use of unresolved identifier error.

unresolved identifier error

I have also implemented tags in info.plist

<array>
<string>fb---------</string>
</array>
<key>FacebookAppID</key>
<string>-----------</string>
<key>FacebookDisplayName</key>
<string>-----------</string>

Still not able to get SDKApplicationDelegate.

func application(_ app: UIApplication, open url: URL,
                 options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
    if SDKApplicationDelegate.shared.application(app, open: url, options: options) {
        return true
    }
    return false
}

Solution

  • Its because SDKApplicationDelegate is changed to ApplicationDelegate

    func application(_ app: UIApplication, open url: URL,
                     options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
        if ApplicationDelegate.shared.application(app, open: url, options: options) {
            return true
        }
        return false
    }
    

    One more thing to do

    class AppDelegate: UIResponder, UIApplicationDelegate
    

    Also import these two pods

    import FBSDKCoreKit
    import FBSDKLoginKit