使用未解析的标识符"GGLContext" [英] Use of unresolved identifier 'GGLContext'

查看:106
本文介绍了使用未解析的标识符"GGLContext"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Google Sign-In集成到我的ios Swift应用程序中.我正在按照Google开发人员页面上的官方说明进行操作( https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift )

I am integrating Google Sign-In in my ios Swift app. I am following the official instructions on the google developer page here(https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift )

这是我的桥接标题:

#ifndef Header_h
#define Header_h


#endif /* Header_h */

#import <CommonCrypto/CommonCrypto.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <GoogleSignIn/GoogleSignIn.h>

当我在AppDelegate.swift函数中调用具有

    GGLContext.sharedInstance().configureWithError(&configureError)

在其中.它说

 Use of unresolved identifier 'GGLContext'

感谢您的帮助.

推荐答案

Google/*窗格已弃用,您应改用pod GoogleAnalyticspod GoogleSignIn.您无法在这些窗格中找到GGLContext,因为它不再存在,因为它不再需要GoogleInfo-Service.plist文件进行Analytics(分析)或登录.

Google/* pods are deprecated, you should use pod GoogleAnalytics or pod GoogleSignIn instead. You can't find GGLContext in those pods because it no longer exists since it no longer requires a GoogleInfo-Service.plist file for Analytics or SignIn.

对于登录,您应该使用先前在 GoogleInfo-Service.plist 文件中获得的clientID进行初始化

For SignIn you should use the clientID that was previously obtained in the GoogleInfo-Service.plist file to initialize

GIDSignIn.sharedInstance().clientID = kClientID

或者如果您使用的是Firebase

or if you are using Firebase

GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID

对于Analytics(分析),您应该使用先前在 GoogleInfo-Service.plist 文件或分析面板中获得的trackerID进行初始化

For Analytics you should use the trackerID that was previously obtained in the GoogleInfo-Service.plist file or in the analytics panel to initialize

let tracker = GAI.sharedInstance().tracker(withTrackingId: kTrackerID)

Google登录文档

Google Analytics(分析)文档

这篇关于使用未解析的标识符"GGLContext"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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