SupabaseS
Supabase3mo ago
oli

Compose-Auth: Sign in with Google on iOS

Hello all,
I've recently implemented Apple and Google sign in providers. The Apple sign in provider is working fine on iOS. And the Google sign in provider is working fine on Android.

The question is, can I make the Google sign in work on iOS? It keeps failing to the fallback. This is the code:

    val googleAuthState = supabaseClient.composeAuth.rememberSignInWithGoogle(
        onResult = { result ->
            when (result) {
                is NativeSignInResult.Success -> {
                    onOnboardingComplete()
                    // Navigation is handled by App.kt observer
                }
                is NativeSignInResult.Error -> {
                    scope.launch {
snackbarHostState.showSnackbar(result.message)
                    }
                }
                is NativeSignInResult.ClosedByUser -> {} // User aborted
                is NativeSignInResult.NetworkError -> {
                    scope.launch {
snackbarHostState.showSnackbar("Network error. Please check your connection.")
                    }
                }
            }
        },
        fallback = { isGoogleSignInAvailable = false } // this fallback is triggered when I attempt to sign in on iOS
    )


I tried follow the Supabase docs, but it doesn't really mention anything about compose multiplatform and iOS. In terms of Google's official resources, they do have some posts about implementing the Google sign in on iOS, but I don't know how to connect that to Supabase's Compose-Auth system.

Will be thankful for any help!
Was this page helpful?