我从事 Web 开发已有几年,这是我的第一个 iOS 应用程序项目。我已按照 Google 的 Get the Google Sign-in SDK for iOS 中的所有说明进行操作(没有 CocoaPods),我尝试模拟应用程序,但出现此错误:Use of unresolved identifier 'GGLContext'
这是从 Google 页面复制并放入 AppDelegate.swift 的代码:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
// Initialize Google sign-in
var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError) // THIS LINE HAS THE ERROR
assert(configureError == nil, "Error configuring Google services: \(configureError)")
//GIDSignIn.sharedInstance().delegate = self
GIDSignIn.sharedInstance().clientID = MY_CLIENT_ID
return true
}
有什么帮助吗?
最佳答案
我遇到了和你一样的问题然后我决定阅读 Google's Tutorial再次寻找“手动”一词,他们是这样说的:
Note: If you manually installed the SDK, you should instead configure the GIDSignIn object directly, using the client ID found in the GoogleService-Info.plist file:
GIDSignIn.sharedInstance().clientID = kClientID
所以只需注释与 GGLContext 相关的行,我认为这应该可以解决这个问题。
关于ios - 代码错误 : "Use of unresolved identifier: GGLContext" (without CocoaPods),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37733373/