

dependencies: [
.package(url: "https://github.com/William-Weng/WWSignInWith3rd_Google.git", .upToNextMajor(from: "1.0.0"))
]
函数 |
功能 |
login(withPresenting:result:) |
登录 |
loginButton(with:primaryAction:) |
Google原生的登录按钮 |
logout() |
登出 |
currentUser() |
登录者的使用者资料 |
isLogin() |
登录是否成功? |
disconnect(result:) |
断开连接? |
import UIKit
import WWPrint
import WWSignInWith3rd_Apple
import WWSignInWith3rd_Google
final class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
/// 設定 <YOUR_IOS_CLIENT_ID> + <YOUR_DOT_REVERSED_IOS_CLIENT_ID>
/// - Parameter sender: UIButton
@IBAction func signInWithGoogle(_ sender: UIButton) {
WWSignInWith3rd.Google.shared.login(withPresenting: self) { result in
switch result {
case .failure(let error): wwPrint(error)
case .success(let info): wwPrint(info)
}
}
}
}