I receive the following error when trying to log in with the iOS Facebook SDK:
Invalid Scopes: public_profile, openid.
I followed the instructions from here which resulted in this setup:
info.plist
<plist version="1.0">
<dict>
...
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>GOOGLE_URL_SCHEME</string>
<string>fbMY_FB_APP_ID</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>MY_FB_APP_ID</string>
<key>FacebookClientToken</key>
<string>MY_FB_CLIENT_TOEN</string>
<key>FacebookDisplayName</key>
<string>MY_FB_APP_NAME</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbauth2</string>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
</array>
</dict>
</plist>
AppDelegate.swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
ApplicationDelegate.shared.application( application, didFinishLaunchingWithOptions: launchOptions )
return true
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
return ApplicationDelegate.shared.application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
}
Login Snippet
let loginManager = LoginManager()
loginManager.logIn(permissions: ["public_profile"], from: self) { result, error in
if let error = error {
print("FB Error: \(error)")
} else if let result = result, result.isCancelled {
print("FB Cancelled")
} else {
print("FB Logged In")
}
}
I’m on iOS 16.2 and using facebook-ios-sdk version 15.1.0. The same error occurs with the FB app in live and development mode. I am receiving the same error on the simulator and the device. I can successfully login to the web when using the FB app JS library. I believe I have followed the instructions correctly. What am I overlooking?
Edit: Settings Screenshots
Edit:
So I just downloaded this sample from facebook-ios-sdk. Added my FB App ID to the FacebookAppID field and URL schemes in the plist. Added the FB Client Token to the plist and updated the bundle id to the one specified in the Facebook app, but I get the same error when I run the sample. What the hell is going on? The problem must be in the Facebook app setup, but where? I can’t find this problem reported anywhere on the web. Surely someone has seen this before.