Search code examples
iosswiftgigya

Gigya Swift Facebook and Google Native login


I am integrating gigya facebook and google to my app. The login process works when using webview, but i am having problems when i use the native apps.

For facebook, i am able to open the native app and it proceeds all the way to the screen where it says "You previously logged in with...", but upon clicking continue, it just returns to the screen where it prompts you to choose between using the facebook app or not.

For google, i have downloaded the Google app into my iOS device. But it is still using the webview with no way to use the Google app.

I am using GigyaSwift v1.0.1. Google and Facebook Wrapper is included in my Compile sources. I have configured the following ID's into my app:

plist


Solution

  • For facebook, i apparently forgot to input some code in my AppDelegate to handle the return from Facebook native app to my app.

    This is the code:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 
       //insert other code here
        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[.sourceApplication] as? String, annotation: options[.annotation])
    }
    

    For Google @Sagi Shmuel was right. Opening of Webview is the expected behavior. Thanks!