Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo-go React-Native application that uses Google Authentication in Firebase

I am building a React-Native application with expo and test it with expo-go. I need to authenticate users to Firebase using Google. I managed to authenticate users in Firebase with email+password, but not with Google.

I have spent several days looking for solutions on the web (and Stack-Overflow) and could not find anything definite or an example that actually works. The proposed methods were: 'signInWithRedirect' and 'signInWithPopup' (both do not work in React-Native), 'expo-google-sign-in' (deprecated) and 'Expo-auth-session' (seems to be the latest method, but many claim it does not work with expo-go).

Is what I try to do even possible? is there a working example anywhere?

Otherwise, what would be the recommended way to authenticate users with Google in Firebase in my application (e.g., use builds instead of expo-go, or use Expo Dev Clients to enhance expo-go, etc.) - any working example please?

Many thanks in advance, I am getting desperate :)

like image 295
Arie Livshin Avatar asked Jan 18 '26 00:01

Arie Livshin


1 Answers

I managed to get firebase google auth working through Expo Go using Expo SDK 47. With the release of Expo SDK 48 in February 2023, I believe it is no longer possible to get it working with Expo Go. See explanation of the SDK 48 updates here.

I was reluctant to migrate to Expo Dev Clients, but it went smoother than anticipated, so I would recommend biting the bullet and moving forward with Expo Dev Client. I believe you will need a paid apple developer account to create the builds. The other issue I'm having with this method, is that I cannot seem to get the authentication flow working in a preview build, although it works fine in the development build. See my question here which has my code sample embedded, which works with the development build.

like image 122
Alex Avatar answered Jan 20 '26 17:01

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!