Google-Anmeldeschaltfläche führt zu nichts
Ich habe das Google-Anmeldeverfahren genau so implementiert, wie es Google laut seiner Website angibt. Ich hatte es vor etwa einem Monat arbeiten, jetzt tut es einfach nichts. Ich habe versucht, alles zu wiederholen, indem ich den Cocoapod gelöscht habe und deren Website einem T gefolgt bin, aber es passiert immer noch nichts. Es ist, als würde keine der Delegate-Methoden aufgerufen, und ich bin mir nicht sicher, warum. Jede Hilfe wäre dankbar. Vielen Dank
import GoogleSignIn
import Google
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//Get Twitter and set Twitter keys for Application
Twitter.sharedInstance().startWithConsumerKey("uBedaxDuMDgImGbjun1oYf0ay", consumerSecret: "OaKqBZUesX5CypHCwrTvTZE22jrXIuRsUeZzVaMHej11R5Vh3b")
Fabric.with([Twitter.self])
// Initialize sign-in GOOGLE
var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")
GIDSignIn.sharedInstance().delegate = self
return true
}
func application(application: UIApplication,
openURL url: NSURL, options: [String: AnyObject]) -> Bool {
return GIDSignIn.sharedInstance().handleURL(url,
sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String,
annotation: options[UIApplicationOpenURLOptionsAnnotationKey])
}
func application(application: UIApplication,
openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
var options: [String: AnyObject] = [UIApplicationOpenURLOptionsSourceApplicationKey: sourceApplication!,
UIApplicationOpenURLOptionsAnnotationKey: annotation!]
return GIDSignIn.sharedInstance().handleURL(url,
sourceApplication: sourceApplication,
annotation: annotation)
}
func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!,
withError error: NSError!) {
print("SIGNING IN")
if (error == nil) {
let email = user.profile.email
print(user.authentication)
// ...
} else {
print("ERROR = \(error.localizedDescription)")
}
}
View Controller
import GoogleSignIn
class LoginViewController: UIViewController, UITextFieldDelegate, CLLocationManagerDelegate, GIDSignInUIDelegate
override func viewDidLoad() {
//Default setup for View Controller
super.viewDidLoad()
GIDSignIn.sharedInstance().uiDelegate = self
var error:NSError?
GGLContext.sharedInstance().configureWithError(&error)
if(error != nil) {
print(error)
}
var signInButton = GIDSignInButton(frame: CGRect(x: 0, y: 0, width: 150, height: 400))
view.addSubview(signInButton)
}
BEARBEITE
Nach HOURS, lol, funktioniert die Google-Anmeldeschaltfläche, wenn sie 1) länger als 2 Sekunden gedrückt gehalten wird, 2) nach links / unten / rechts, aber nicht nach oben gewischt wird sei offen für Vorschläge! Vielen Dank