registerWithGoogle
Registers a new user with their Google account using Google Sign-In.
This method is functionally identical to signInWithGoogle as Firebase automatically creates a new user account if the Google account hasn't been used before. The separation exists to provide semantic clarity in the UI (showing "Register" vs "Sign In" flows).
Process
Shows Google account picker UI
User selects a Google account
Retrieves Google ID token
Authenticates/creates account with Firebase using the Google credential
Returns the authenticated user
Requirements
Same as signInWithGoogle
Exceptions
Same as signInWithGoogle
Example
// In your registration ViewModel
fun registerWithGoogle() {
_uiState.updateStateWith {
authRepository.registerWithGoogle(activity)
}
}Return
The authenticated AuthUser upon successful registration/sign-in
Parameters
The activity instance required for showing the Google Sign-In UI
See also
Throws
if user cancels the operation
for Google Sign-In or Firebase authentication failures