Comments (15)
upon successful login you should automatically get your user object each time you open the app. that's how silent login is supposed to work.
what do you mean when you say not working ? can you share some of your code ?
from google-signin.
Thanks for getting back so quickly! My current code is:
// Configure Google
GoogleSignin.configure({
iosClientId: config.google.client_id,
scopes: config.google.scopes,
// webClientId: config.google.webClientId,
// offlineAccess: true
});
GoogleSignin.currentUserAsync().then((user) => {
console.log('USER', user);
}).done();
The problem I'm seeing is that user
is null
even though the user is authenticated and should be silently logged in.
This worked in my app prior to 0.4.0
when I was listening for the googleSignIn
event.
from google-signin.
Something that may be of interest is that when I wrap the currentUserAsync call in a setTimeout like so:
setTimeout(() => {
GoogleSignin.currentUserAsync().then((user) => {
console.log('USER', user);
}).done();
}, 3000);
I'll get the user object returned about 50% of the time
from google-signin.
I just realized this issue can be seen in the example ios app included in this repo.
from google-signin.
which is strange. I just started the example app multiple times and I get my user every time with silent signin
from google-signin.
That's really strange. If it's of any help here's a screen recording of what I'm running into.
https://www.dropbox.com/s/9aftno3m42g4xfs/google-sign-in-issue.mov?dl=0
from google-signin.
thanks for the screencast, very helpful.
If you restart your application (CMD + R in xcode) and not just reload it, you will see that the silent signin is properly working. but I don't get why user is null when your reload the app. I'll investigate.
you say it was working fine with version 0.3.x ?
from google-signin.
Yes it was working in 0.3.x.
One thing I noticed (again, I don't really know objective c) is that this line https://github.com/apptailor/react-native-google-signin/blob/master/RNGoogleSignin/RNGoogleSignin.m#L28 was previously being called when you would call GoogleSignin.configure
but now it's not being called until the currentUserAsync function.
from google-signin.
I made some kind of fix / hack :
from xcode, replace the content of RNGoogleSignin.m
with this gist https://gist.github.com/devfd/4a544346f4a16f4043ce
I will see if I can find something better before merging with master
from google-signin.
the issue with signInSilently
is that I get an error from the google sdk right after I reload the app even if placed inside configure
method. it is like if the user has been erased while reloading.
from google-signin.
it was a simple fix after all. the issue was with how the signin scopes were setup.
all good and well in v0.4.1
to update correctly don't forget to restart react-native packager et rebuild ios project
from google-signin.
Thanks for your prompt action, @devfd! Sadly it seems the issue still persists - but it is better!
The silent login isn't working when the app is reloaded (via CMD + R) but it does correctly sign in when the app is rebuilt.
Let me know if there is any more details or other ways I can help sort this out. I greatly appreciate your time for looking into this!
from google-signin.
Also, it seems that v0.4.1
didn't make it onto npm (I just made the changes manually)
from google-signin.
I went through a fresh installation of v0.4.1 this morning and realized that while testing I was changing the wrong thing. I went through a fresh installation of react-native-google-signin
(including taking the steps outlined in the ios guide again) and everything seems to be working correctly again!
Thank you very much for your help @devfd!
from google-signin.
great ! let me know if you still have some troubles using the lib
from google-signin.
Related Issues (20)
- 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
- Google Signin Works on Emulator but not on Web HOT 1
- Free Sponsor Access for Early-Stage Startups? HOT 2
- Unable to install sponsored version HOT 1
- Terminating app due to uncaught exception 'NSInvalidArgumentException' HOT 2
- Is there any cache in this library? reversed_client_id doesn't change even if Info.plist changed HOT 1
- Prevent crashes on mobile web HOT 1
- "[app] wants additional access to your Google Account" on re-sign-in on iOS. HOT 6
- google sign in not working when using an actual mobile: tried two views with the same name RNGoogleSigninButton HOT 5
- Cannot get signIn() working with Supabase HOT 15
- Dependency conflict between React and React Native versions when installing @react-native-google-signin/google-signin package HOT 9
- Framework 'hermes' not found HOT 1
- java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference HOT 5
- RNGoogleSignin: failed to determine clientID - GoogleService-Info.plist was not found and iosClientld was not provided. HOT 4
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.