Comments (4)
This blog helped: https://hackernoon.com/google-sign-in-and-expo-go-a-guide-to-help-you-fix-any-issues-that-arise
Don't think it's a sponsorship issue, at least now
@vonovak, if you need proper sponsorship, I might be able to help. This is an important library that should be supported by a corporate partner. Will be sad if you have to gate critical features for it
from google-signin.
I'm experiencing this exact same issue with the same dependencies. Did you figure this out OP?
Like here in this guide: https://react-native-google-signin.github.io/docs/one-tap#web-support
This functionality is only available to sponsors️. It takes just a few clicks to get access ❤️.
What is "this"? Web? Is that why it's crashing? I'm all for seizing your opportunity for income, but pretty irritated if this is causing my web app to crash.
from google-signin.
I figured this out! This was not very clear to me upfront. Web is incompatible with (at least the free version of) react-native-google-signin/google-signin
because it's a "react native" package for mobile. Those of us who are using true react-native
in a mono-repo to support mobile and web will get a crasher.
How to fix:
- Locate all references to
'@react-native-google-signin/google-signin'
and make a list of the functions used in your code - Start going down the list and making platform specific files / functions for web. You can use react native's platform specific file extensions to make a file for mobile and a file for web.
Example, please note that this works for me because of my specific setup where I can assume that google signin will always be an option in web.
isGooglePlayAvailableAsync.ts
import { GoogleSignin } from '@react-native-google-signin/google-signin';
export default async () => GoogleSignin.hasPlayServices();
isGooglePlayAvailableAsync.web.ts
export default async () => true;
- In your code import the file:
import isGooglePlayAvailableAsync from './isGooglePlayAvailableAsync'
and use this to replace all instances ofGoogleSignin.hasPlayServices
Example:
import isGooglePlayAvailableAsync from './isGooglePlayAvailableAsync'
const Button = () =>
<TouchableOpacity onPress={()
=> isGooglePlayAvailableAsync().then(() => {
// do something
})}>
</TouchableOpacity>
- This works because the native code can't actually be compiled properly for web, so even if you're not invoking a method, your app will crash if the native package is imported into a file that is used at runtime.
from google-signin.
Hello and thanks for asking,
The reason you're getting this issue is that you're importing the package on the web. Importing on the web, even if not directly calling the package, leads to the error.
The free package was made to work on Android and iOS. The package was always native-first and web support was never considered. This is, to my knowledge, the first issue that reports this problem in this way.
I agree that a hard-crash is not the right behavior and I will implement a change that will log a warning, but won't crash. However, I'm vacationing now and I'll get to it at the end of May.
@sudowoodo200 I'll be very happy if you can find a partner that would be willing to support the maintenance. You can reach out to me to discuss this using the contact information listed in my profile.
Thank you 🙂
from google-signin.
Related Issues (20)
- RN GoogleSignin native module is not correctly linked HOT 1
- DEVELOPER_ERROR on Play Store release android HOT 1
- Google Sign-In not working on Android HOT 7
- Google Signin not working after release on play store - Error: DEVELOPER_ERROR HOT 15
- There is no definitions for GoogleOneTapSignIn and Type OneTapUser HOT 1
- uncaught error: RN GoogleSignin native module is not correctly linked HOT 3
- Retrieve Refresh Token for Google Calendar in React Native HOT 1
- NSInvalidArgumentException: Your app is missing support for the following URL schemes HOT 2
- Google signin not working on IOS (17.04) HOT 1
- Error during login: [TypeError: Cannot read property 'user' of undefined] HOT 1
- Validate accessToken generate from iOS is invalid_error on server HOT 1
- My app shows google login panel, I changed the email and client Id in the code then get this error. HOT 1
- Sign in doesn't seem to be working in custom Expo Dev Client HOT 4
- URL Access Anti-virus Security issue HOT 2
- Restore Flow typings for v12 HOT 2
- [Docs] iOS docs unusable for Expo HOT 2
- Support for react-native-macos HOT 2
- Compatible version for react native 0.61.5 HOT 1
- Mock not working in 12.1.0 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-signin.