I just started using the new GigyaSwift SDK and i'm trying to implement facebook social login on an existing project. However, when i try to login using facebook, i get an error:
Fatal error: [facebook] can't login with WebView, install related sdk.
I have imported the SDK and wrappers in my project, and installed the FBSDK pods. This is my code:
Gigya.sharedInstance().login(with: .facebook, viewController: self, completion: { (res) in
debugPrint(res)
})
These are the fields i have inputted into my plist.
<key>GigyaApiDomain</key>
<string>REDACTED</string>
<key>GigyaApiKey</key>
<string>REDACTED</string>
<key>FacebookDisplayName</key>
<string>REDACTED</string>
<key>FacebookAppID</key>
<string>REDACTED</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fbAPP ID HERE</string>
</array>
</dict>
</array>
I have tried to implement this on a new project and i was able to get it to work. I have tried to copy the settings of the new project to my existing one but that didn't work. A possible cause i have found is that the FacebookWrapper is not executing on login. Has anyone encountered this scenario and is there a fix for it?
EDIT: As requested by @Sagi Shmuel , here is the print result of my facebook wrapper with redacted names.
([REDACTED].FacebookWrapper) $R0 = 0x00006000002a4d00 {
ObjectiveC.NSObject = { isa = [REDACTED].FacebookWrapper } completionHandler = 0x000000010540f4e0 [REDACTED]`closure #1 (Swift.Optional>, Swift.Optional) -> () in variable initialization expression of [REDACTED].FacebookWrapper.(completionHandler in _D4653B6ACC181DF040059B860A43FAE8) : (Swift.Optional>, Swift.Optional) -> () at FacebookWrapper.swift:16
clientID = nil defaultReadPermissions = 1 value { [0] = "email" } fbLogin.storage = nil
That's happened because the GigyaSwift SDK
not found the FacebookWrapper.swift
file.
Make sure you install Facebook SDK
and add FacebookWrapper.swift
file your project and.