WWSignInWith3rd_Google

main

Use Google third-party login.
William-Weng/WWSignInWith3rd_Google

WWSignInWith3rd+Google

Swift-5.6 iOS-14.0 Swift Package Manager-SUCCESS LICENSE

dependencies: [
    .package(url: "https://github.com/William-Weng/WWSignInWith3rd_Google.git", .upToNextMajor(from: "1.0.0"))
]

Function - 可用函式

函式 功能
login(withPresenting:result:) 登入
loginButton(with:primaryAction:) Google原生的登入按鈕
logout() 登出
currentUser() 登入者的使用者資料
isLogin() 登入是否成功?
disconnect(result:) 斷線?

Example

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)
            }
        }
    }
}

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

Last updated: Mon Apr 15 2024 04:39:49 GMT-0900 (Hawaii-Aleutian Daylight Time)