react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.13k stars 876 forks source link

Adding support for react-native-web #1149

Closed cdanwards closed 8 months ago

cdanwards commented 1 year ago

Hello! Thank you so much for providing this great resource for Google sign in for React Native.

Currently, it's a great library for implementing Google Sign In in React Native applications. However, we have a use case where we are using react-native-web and would like to use the same library for Google Sign In on both the native app and web app, but the library only supports native platforms.

My team and I would be interested in contributing to the project by adding support for web-based Google Sign In for the react-native-web use case. This would allow us to have a unified implementation of Google Sign In across both native and web platforms, reducing the need for maintaining multiple libraries or implementations for the same feature.

Is this something that you would be open to? Thank you!

Minishlink commented 1 year ago

Hello, it is my understanding that Google forbids using google signin in a webview https://developers.googleblog.com/2021/06/upcoming-security-changes-to-googles-oauth-2.0-authorization-endpoint.html

EDIT: wow I need holidays, I read react-native-webview instead of react-native-web

vonovak commented 1 year ago

hello @cdanwards Thanks for your patience and for your comment. I'm personally not very familiar with the google sign in sdk for web and with the api that is offers. If the API for web can be covered with the existing methods without a major overhaul of the existing api then I think it would be nice to offer web support as well!

From my point of view, what is necessary is to have an example app that can be used for development of the module. The current example app is old and needs to be migrated to rnta. I'm planning to do it as part of https://github.com/react-native-google-signin/google-signin/issues/1090 but so far the sponsorships generated close to nothing 😄.

RNTA doesn't support web though, so another app for web would need to be added, maybe an expo app?

Also, once it's merged, it would be nice if you or someone from your team could stick around and provide bugfixes for the web support. I think I can do it myself to some extent but I cannot promise it.

vonovak commented 8 months ago

Fyi: I started working on this and will have this ready in a few days 👍.

vonovak commented 8 months ago

hello, this is now available! 🙂

docs: https://react-native-google-signin.github.io/docs/one-tap

mshivam019 commented 3 months ago

Any plans to make it available for non-sponsors?

vonovak commented 3 months ago

Any plans to make it available for non-sponsors?

Hello, no, there are no such plans at the moment. I'm going to make new architecture support public in the next few weeks, but One Tap for Android and the web will stay for sponsors only. Thank you 🙂

fernandasecinaro commented 2 months ago

Hello!

Thanks for this library, I added it for native and it's awesome!

However, I'm getting the following error in web:

RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully.

i wonder if it's because i should sponsor the library to compile for web or i missed something

Thanks!

iamsoltan commented 2 months ago

I achieved success by utilizing it with just native version and the web version with a different Google authentication package , leveraging the .web.js/.native.js feature.