Comments (7)
Hello and thanks for reporting,
judging by the stack trace (mentions of unsupportedSchemes
and relevantURLSchemes
) I'm guessing that the error has to to do with checking the url schemes the app supports.
I was unable to reproduce this on my test project so without a runnable reproduction, I won't be able to assist further.
As for the config plugin iosUrlScheme
parameter, please note that this parameter is only available to sponsors of the module, it's not part of the public package.
Finally, in the provided snippet
GoogleSignin.configure({
scopes: [
"https://www.googleapis.com/auth/userinfo.profile",
],
webClientId: Platform.OS === 'android' ? <android_client_id> : <web_client_id>,
iosClientId: Platform.OS === 'ios' ? <ios_client_id> : undefined,
offlineAccess: false,
});
the webClientId
parameter is wrong: it should always be the web client id, not the android_client_id
.
I'm going to close this but feel free to provide a runnable repro so I can debug this.
Thank you 🙂
from google-signin.
@vonovak Your analysis of the stack trace helped me find the issue! I opened the project in Xcode and in the Info > Url Schemes section there was an empty url scheme for some reason, removing that fixed the crash.
With some trial and error I found that this section I had added to my app.json was causing the empty url schemes:
{
"expo": {
"ios": {
...,
"infoPlist": {
"CFBundleURLTypes": [
{
"CFBundleURLSchemes": "com.googleusercontent.apps.xxxxxxxxxxxxx"
}
]
}
}
}
}
Per [this documentation|https://docs.expo.dev/versions/latest/config/app/#infoplist] on the expo website, but probably I did something wrong. I think I had added this because I had googled some stuff about needing the url bundles in the info.plist and thought that would do it.. evidently not.
Anyways just putting this here in case some other unfortunate soul happens to stumble into the same set of circumstances. Thanks for your help!
from google-signin.
I observed the same behaviour in my expo app and solved it by providing the iosUrlScheme option to the config plugin. You can read more here.
from google-signin.
@htcdang I already have this in my app.json
for a few days now of trying to get this working:
"plugins": [
....,
"@react-native-google-signin/google-signin",
{
"iosUrlScheme": "com.googleusercontent.apps.xxxxxxxxx"
}
],
from google-signin.
I am still facing the same issue! The app is getting crashed on iOS. On Android it is working fine. My app is managed by expo so I cannot use xcode. I am not using the sponsored version.
app.json
"plugins": [
"expo-apple-authentication",
[
"@react-native-google-signin/google-signin",
{
"iosUrlScheme": "com.googleusercontent.apps.xxx-xxx"
}
]
],
"ios:{
"bundleIdentifier": "myapp",
"infoPList": {
"CFBundleURLTypes": [{"CFBundleURLSchemes":["com.googleusercontent.apps.xxx-xxx"]}],
"UIRequiresFullScreen": true,
.....
GoogleLogin.js
const SignIn = async () => {
try {
GoogleSignin.configure({
webClientId: "xxx-xxx.apps.googleusercontent.com",
androidClientId: "xxx-xxx.googleusercontent.com",
iosClientId: "xxx-xxx.apps.googleusercontent.com",
})
// GoogleSignin.configure({
// scopes: [
// "https://www.googleapis.com/auth/userinfo.profile",
// ],
// webClientId: Platform.OS === 'android' ? 'xxx-xxx.apps.googleusercontent.com' : 'xxx-xxx.apps.googleusercontent.com',
// iosClientId: Platform.OS === 'ios' ? 'xxx-xxx.apps.googleusercontent.com' : undefined,
// offlineAccess: false,
// });
await GoogleSignin.hasPlayServices();
const userInfo = await GoogleSignin.signIn();
I am unable to get any userInfo, instead the app crashes. Unable to get any logs!
I am using:
"expo": "~49.0.6",
"react-native": "0.72.6",
"@react-native-google-signin/google-signin": "^11.0.0"
Thanks in advance for any suggestion/help.
from google-signin.
The problem is that the config plugin only works when using GoogleService-Info.plist
. I've looked through the code and the config plugin uses expo/config-plugins
IOSConfig.Google.withGoogle
internally which does nothing with iosUrlScheme
and so when you run expo prebuild
it fails to add the scheme to the ios apps Info.plist
.
That's why configuring it directly works. Which is what the expo docs suggest. i.e. You could also add it to ExpoConfig['scheme']
because it can be an array
{
"ios": {
...
"infoPlist": {
"CFBundleURLTypes": [
{
"CFBundleURLSchemes": ["com.googleusercontent.apps.17898xxxxxx-xxxxxqhqj0exxxxxpl03xxx"]
}
]
}
}
}
I'm further confused with this library because the docs reference versions 12 and 13 that do not exist in npm
![image](https://private-user-images.githubusercontent.com/59875/305586691-f1614c1c-c9cd-4a7a-89f2-1f325d1c589a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAzNzIzNDEsIm5iZiI6MTcxMDM3MjA0MSwicGF0aCI6Ii81OTg3NS8zMDU1ODY2OTEtZjE2MTRjMWMtYzljZC00YTdhLTg5ZjItMWYzMjVkMWM1ODlhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzEzVDIzMjA0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4NjJhNDAxODRlMWZiZDU5MTYyNjIzNjA4OTczOTYyMGEwMzg4N2JmMDYwNzAxNmU5ZmY4ZTc4ZGI3ZWQxN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KmBQjSqFyKBL9v38iYJqe37_UPMAOOlMnyd3utE4dws)
from google-signin.
Is anyone able to solve this yet? I have followed the above steps and still have the same issue of app crashing on clicking 'Google Signin'. The crash occurs when executing Googlesignin.Singin(). Using iOS dev build.
I am using an expo-managed workflow.
This is my app.json
"googleServicesFile": "./GoogleService-Info.plist", "infoPlist": { "CFBundleURLTypes": [ { "CFBundleURLSchemes": ["com.googleusercontent.apps.-----"] } ],
Also tried this:
"plugins": [ [ "@react-native-google-signin/google-signin", { "iosUrlScheme": "com.googleusercontent.apps.--------" } ],
Have also tried adding directly to plist file:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>com.googleusercontent.apps.-------</string> </array> </dict> </array>
from google-signin.
Related Issues (20)
- Accessing Google's info in scopes HOT 1
- Incorrect version number in docs? HOT 1
- iOS Error when running pod install: CocoaPods could not find compatible versions for pod "ExpoAdapterGoogleSignIn" HOT 3
- Developer Error For Internal Testing HOT 2
- Additional SignIn Parameters
- missing dependencies HOT 2
- OneTap fails on web when 'sign-in prompts' are disabled HOT 4
- App crashing on iOS while tapping on Sign in with Google! HOT 4
- signInSilently gives error [Error: SIGN_IN_REQUIRED] HOT 8
- Unable to install sponsored version HOT 3
- Solution to issue #1176 (Supabase on iOS with Expo) HOT 2
- How to import isErrorWithCode HOT 2
- 11.0.0: CocoaPods could not find compatible versions for pod "ExpoAdapterGoogleSignIn": HOT 1
- [Website] Example links don't work HOT 2
- Include of non-modular header inside framework module 'GTMAppAuth.GTMAppAuthFetcherAuthorization': HOT 1
- (DEVELOPER_ERROR) Only in production Android HOT 1
- Tried to register two views with the same name RNGoogleSigninButton error
- I am not getting user's Birthday HOT 2
- AppAuth 1.7.0 will give 'No visible @interface for 'OIDAuthorizationResponse' declares the selector 'tokenExchangeRequestWithAdditionalParameters:' HOT 8
- no visible @interface for 'OIDAuthorizationResponse' declares the selector 'tokenExchangeRequestWithAdditionalParameters:' HOT 3
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.