SDKApplicationDelegate Use of unresolved identifier

Krutika Sonawala picture Krutika Sonawala · May 15, 2019 · Viewed 8.6k times · Source

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
}

Answer

Wings picture Wings · May 15, 2019

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