Comments (6)
@tareq0065 This warning means you are not handling your promise errors. Are you sure you are providing error handler to all your promises?
Make sure to either use catch
or provide two functions to then
for all promises.
from react-native-google-sign-in.
@tareq0065 you can do something like:
...
try {
await GoogleSignIn.configure({
clientID: '531870286570-28gcrs4oin53rb0aoc8igkutfo2gfijr.apps.googleusercontent.com',
scopes: [
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/drive.appdata',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.metadata',
'https://www.googleapis.com/auth/drive.metadata.readonly',
'https://www.googleapis.com/auth/drive.photos.readonly',
'openid', 'email', 'profile'
],
offlineAccess: true,
forceCodeForRefreshToken: false
});
const user = await GoogleSignIn.signInPromise();
setTimeout(() => {
alert(JSON.stringify(user));
}, 2000);
} catch (error) {
// At least this, but a better handler of the error is better
console.log(error);
}
...
With the ExampleApp the console.log
with the try catch
shows:
{code:10, error: "DEVELOPER_ERROR"}
This seems to be the lack of a SHA1 in the Firebase Console from my app.
from react-native-google-sign-in.
Same Probelm Here also
from react-native-google-sign-in.
from react-native-google-sign-in.
Even I was facing this issue. You can try something like this
const authorizeWithPermissions = () => {
const iosClientId = Config.IOS_GOOGLE_CLIENT_ID;
const androidClientId = Config.ANDROID_GOOGLE_CLIENT_ID;
const serverClientID = Config.GOOGLE_SERVER_ID;
let googleSignConfiguration = {
scopes: ["email", "https://www.googleapis.com/auth/plus.me", "profile", "https://www.googleapis.com/auth/gmail.readonly"],
clientID: iosClientId,
serverClientID
};
if (Platform.OS === "android") {
googleSignConfiguration = Object.assign({}, googleSignConfiguration, {
clientID: androidClientId,
offlineAccess: true
});
}
return GoogleSignIn.configure(googleSignConfiguration)
.then(() => {
GoogleSignIn.signOut();
return GoogleSignIn.signInPromise();
})
.then((user) => {
user.ok = true;
return user;
})
.catch(() => {
const user = {};
user.ok = false;
return user;
});
};
registerGoogle = () => {
this.toggleLoader();
authorizeWithPermissions()
.then((response) => {
const {idToken, serverAuthCode, ok} = response;
if (!ok) {
this.toggleLoader();
return;
}
.......
});
};
from react-native-google-sign-in.
try use try and catch
from react-native-google-sign-in.
Related Issues (20)
- Google+ Shutdown HOT 1
- Failed to compile release APK react native 0.60.3
- Apple Mach-O Linker (id) Error
- Must I use firebase? HOT 2
- Doesn't stay signed in when restarting app HOT 1
- Error code 8 with new account sign in HOT 5
- How to render "GoogleSignIn" Button? HOT 1
- "disconnect()" is not revoking the authentication.
- Project obsolete? HOT 4
- Setup Swift Bridging Header link not working HOT 1
- ld: library not found for -lDoubleConversion
- RNGoogleSignInEvents.swift:11:29: Use of undeclared type 'RCTEventEmitter' HOT 1
- Warning Issues for RNGoogleSignInEvents and RNGoogleSignIn HOT 5
- FAILURE: Build failed with an exception. Could not find com.google.android.gms:play-services-base:12.0.1 HOT 1
- i love you
- ld: library not found for -lRNGoogleSignin HOT 2
- Project with path ':react-native-google-sign-in' could not be found in project ':app'. HOT 1
- The operation couldn’t be completed. (com.google.HTTPStatus error 400.) HOT 1
- Issue with RN v0.57.0
- error reactNativeGoogleSignin currenntUserAsync is not function
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 react-native-google-sign-in.