【发布时间】:2016-10-10 13:03:30
【问题描述】:
我从事 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
}
有什么帮助吗?
【问题讨论】:
-
您是否在项目的桥接头中添加了
#import <GoogleSignIn/GoogleSignIn.h>,正如这里所说的那样? developers.google.com/identity/sign-in/ios/… -
由于某种原因这不起作用所以我做了
#import "exact\location\of\GoogleSignIn.h"
标签: ios xcode swift google-signin