iOS Swift:谷歌登录时出错 [英] iOS Swift : error with google login

查看:248
本文介绍了iOS Swift:谷歌登录时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注使用swift在我的iOS应用中添加谷歌登录的教程。我按照提到的所有步骤进行了操作,但是当我尝试构建应用程序时,它在我的appdelegate.swift文件中给了我一个问题。

I was following this tutorial to add google sign in in my iOS app using swift. I followed all the steps as mentioned but when I try to build app then it is giving me an issue in my appdelegate.swift file.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    var configureError: NSError?
    GGLContext.sharedInstance().configureWithError(&configureError)
    assert(configureError == nil, "Error configuring Google services: \(configureError)")

    GIDSignIn.sharedInstance().clientID = "client id"

    return true

}

所以低于代码行

GGLContext.sharedInstance().configureWithError(&configureError)

错误文本是使用未解析的标识符GGLContext。这可能是什么问题?

Error text is "Use of unresolved identifier GGLContext". What could be the issue here ?

推荐答案

我找到了解决方案,你可以使用Bridge-Header.h文件并像那样导入

I found the solution, You can use the Bridge-Header.h file and import like that

#ifndef Bridge_header_h
#define Bridge_header_h

#import "Google/Core.h"
#import "GoogleSignIn.h"

#endif /* Bridge_header_h */

它完美地完成了我的工作。

it's work perfectly at my end.

这篇关于iOS Swift:谷歌登录时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆