New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Its not redirecting to mobile app after Google login, instead it goes to google.com #5032
Comments
Google.loginAsync is already deprecated please use GoogleSignIn for google authentication, just follow this link on how to update your code: https://docs.expo.io/versions/v33.0.0/sdk/google-sign-in/ |
no @martin9908 its not deprecated its working fine, just not redirecting to app after google login |
You need to pass the redirectUrl as a string, easiest would be to use JavaScript template strings |
i have already done this but still going to google.com after login try { |
@cruzach check my App.json once , i am using sdk32 { and Package.json { |
@reactexcel - please don't open new issues, it doesn't increase the response time. You still haven't followed the issue template which we provide for you. Please go back and edit your post to include all of the information we ask for, formatted correctly. In the meantime, I see you're using SDK 32. Could you test your code on an SDK 33 project, and let me know if you hit the same error? Also- it's really helpful to place "```" before and after your code that you are sharing, as that formats it very nicely. |
ok won't create the same issue as you told me to check it with sdk33, i check it on dev mode but getting no response (no error no response). |
and @cruzach please can you tell me why is GoogleSignIn giving an error of some async operation are still in pending. |
You've most likely misconfigured something in the setup here. I would go through the docs and make sure you've followed each step.
Without a way to reproduce it on my end, I can't say why this would/is happening. |
I too am seeing this issue. It's only happening in android standalone apps. Upon closer inspection, the expo-app-auth module generates a default redirect url as I've provided a solution on my end by using |
@cberigan can you provide a way for me to reproduce this? |
@cruzach Let me put something together. It may take me a day or 2. |
@cruzach Attached is a sample project. Just build the expo project for android, install, and run. The App.js contains some comments to reproduce. |
@cberigan - the standalone build failed 😕 |
What was the issue? I was able to build it on android. |
Is there is any round around approach for solving this issue? I just updated the application to 34.0.0. It's redirecting to the google.com, If there is any temporary fix that would be helpful. |
You can pass |
@cruzach The fix you made on the merged PR makes sense and after changing my code I can see that the config passed into the |
@vinagrito Read my comment. Use ${AppAuth.OAuthRedirect}:/oauthredirect as the redirectUri. If in doubt, download the project zip in one of my comments and it has both the reproduced bug and solution |
@cberigan indeed the test app you posted works as expected 😄. Should I believe then my oauth clients are not configured correctly?. Should my API key be restricted to android apps?. Also, I see that the
I don't see a |
@cberigan Is there a correlation between the SHA1 hash in expo used for the signing with the one defined in the google developer oauth client ID? |
@cberigan OK, so I managed to fix it. My identifier contains a capital letter, kind of a: |
@vinagrito that was my issue too...thanks for posting this! |
@vinagrito @andersco which oauth client ID did you end up changing? I'm having the same issue, and we also have a capital letter in our identifier, but changing it in the Google Developer Console seems to have no effect |
@kgpasta I changed the package name in my oauth client ID that is used for Android (not expo) to be all lowercase and that fixed the issue for me. |
thanks @andersco that fixed it! |
Sorry @cruzach to open this issue again, i need to open this issue again as:
still its not working
here is my code :-
try {
const result = await Google.logInAsync({
androidClientId:"xxxx",
scopes: ['profile', 'email'],
redirectUrl:${AppAuth.OAuthRedirect}:/oauth2redirect/google
});
console.log(result);
} catch(e) {
console.log({e});
}
i did not make any change in node_modules.
and one more question , what should be the package name in production mode?
As now i am using host.exp.exponent for dev mode and com.xxxx(as it is in app.json) so is it right?
Thanks
The text was updated successfully, but these errors were encountered: