简体   繁体   English

Gigya Swift Facebook和Google Native登录

[英]Gigya Swift Facebook and Google Native login

I am integrating gigya facebook and google to my app. 我正在将gigya facebook和google集成到我的应用程序中。 The login process works when using webview, but i am having problems when i use the native apps. 使用webview时登录过程有效,但是使用本机应用程序时出现问题。

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. 对于facebook,我能够打开本机应用程序,并且一直进行到屏幕上显示“您以前用...登录过”的屏幕,但是单击继续后,它仅返回到屏幕,提示您进行以下操作:选择是否使用Facebook应用程序。

For google, i have downloaded the Google app into my iOS device. 对于Google,我已经将Google应用下载到了我的iOS设备中。 But it is still using the webview with no way to use the Google app. 但它仍在使用Webview,无法使用Google应用。

I am using GigyaSwift v1.0.1. 我正在使用GigyaSwift v1.0.1。 Google and Facebook Wrapper is included in my Compile sources. Google和Facebook包装器包含在我的编译源中。 I have configured the following ID's into my app: 我已经在我的应用中配置了以下ID:

plist中

基本上GigyaSwift使用GoogleSign-In SDK并打开webView ,您也可以在GoogleWrapper.swift文件中看到实现。

For facebook, i apparently forgot to input some code in my AppDelegate to handle the return from Facebook native app to my app. 对于facebook,我显然忘记了在我的AppDelegate中输入一些代码来处理从Facebook本地应用到我的应用的返回。

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. 对于Google,@ Sagi Shmuel是正确的。 Opening of Webview is the expected behavior. Webview的打开是预期的行为。 Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM