I am still new to React Native and I would like to let users use a google account on my React Native app. My question is if signInWithRedirect function is available in native apps. I first wrote signInWithPopup, but I got an error and found out I couldn’t use it in native apps. Also, I used a redirect function, but it didn’t work well.
I deleted all my code and used createUserWithEmailAndPassword, but honestly, I still want users to log in with their google accounts.
2
Answers
Unfortunately, that is not possible in React Native world. It seems that you already have some web experience, so this deep dive might be helpful for you to understand why React Native allows you to use web technologies while developing a native app: https://www.infoq.com/articles/react-native-introduction/
But the solution you are looking for is react-native-firebase which is the officially recommended collection of packages that brings React Native support for all Firebase services on both Android and iOS apps.
Firebase Authentication
setup instructions: https://rnfirebase.io/auth/usageFirebase Authentication
withgoogle-signin
: https://github.com/react-native-google-signin/google-signinShorten yourself and use react-native-firebase
And that using tool Authentication
But make sure that the application is well connected, then you will get many features that save you time, such as: Dashboard, mail confirmation, and types of login methods (Facebook and …) Even that you can create a login method as a guest