INNER CODE UNIT · Swift

googleOauth

joreilly/Confetti · iosApp/iosApp/Authentication.swift:8

    func googleOauth() async throws -> User {
        // google sign in
        guard let clientID = FirebaseApp.app()?.options.clientID else {
            fatalError("no firbase clientID found")
        }

        // Create Google Sign In configuration object.
        let config = GIDConfiguration(clientID: clientID)
        GIDSignIn.sharedInstance.configuration = config
        
        //get rootView
        let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene
        guard let rootViewController = scene?.windows.first?.rootViewController
        else {
            fatalError("There is no root view controller!")
        }
        
        //google sign in authentication response

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…