Skip to content

Instantly share code, notes, and snippets.

@Jerry0420
Created October 12, 2016 04:40
Show Gist options
  • Save Jerry0420/18f5afd0bfa514d2fd441d196a8c3324 to your computer and use it in GitHub Desktop.
Save Jerry0420/18f5afd0bfa514d2fd441d196a8c3324 to your computer and use it in GitHub Desktop.
將以下程式碼加入AppDelegate內
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
var error : NSError?
GGLContext.sharedInstance().configureWithError(&error)
if error != nil{
print(error)
}
return true
}
//按下登入鈕後,畫面會跳轉到網頁,進行帳號密碼確認,此方法實作確認完帳號密碼後,畫面跳轉回原ViewController
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return GIDSignIn.sharedInstance().handle(url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment