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)
- 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
- Error: RN GoogleSignin native module is not correctly linked. Please read the readme, setup and troubleshooting instructions carefully. HOT 1
- Can't access your doc site HOT 4
- bridgeless mode HOT 2
- Remove scopes HOT 1
- The Swift pod `GTMAppAuth` depends upon `GTMSessionFetcher` and `AppAuth` HOT 12
- Upgrade GoogleSignIn-iOS to 7.1.0 in order to support Apple Privacy Manifest HOT 11
- RN GoogleSignin native module is not correctly linked HOT 1
- Unable to open links the terms and policy HOT 1
- Please publish proper latest version 11.0.1, not 10.1.2 HOT 1
- Unable to find a specification for `GoogleSignIn (~> 7.0.0)` depended upon by `RNGoogleSignin` HOT 1
- Checking information screen after sign in and manual login. HOT 1
- RN GoogleSignin native module is not correctly linked HOT 1
- DEVELOPER_ERROR on Play Store release android HOT 1
- Expo web: RN GoogleSignin native module is not correctly linked HOT 4
- Google Sign-In not working on Android HOT 5
- Google Signin not working after release on play store - Error: DEVELOPER_ERROR HOT 12
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.