Error 10 in ionic native google plus login

10.6k views Asked by At

I am using ionic native google plus login but I am getting error 10 after doing the same.

Below is my code :-

 doGoogleLogin(){
    this.googlePlus.login({})
      .then(res => {
        this.router.navigate(['./tabs']);
        this.userInfo = JSON.stringify(res);
        console.log(res);
      })
      .catch(err =>{
        console.log(err)
        this.userInfo = JSON.stringify(err);
      })
  }
6

There are 6 answers

1
Chanaka Weerasinghe On BEST ANSWER

After Searching 4 days i figured out you have to do simple steps do that carefully.

1 first check your ionic version

if it ionic 3

Install the Cordova and Ionic Native plugins:

 $ ionic cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid
 $ npm install --save @ionic-native/google-plus@4

Add this plugin to your app's module

2.go to Google Cloude Console

Google Cloude Console

3.create Auth2

4.add your app id that com.xxxxxx.xxxxxx

0
Pullat Junaid On

I finally found a solution. I knew there was something to do with cordova not signing the APK with my ~/.android/debug.keystore file, so I created a debug-signing.properties file in the platforms/android folder and specified there the keystone path, password etc.

Things worked fine after that

Cheers !

debug-signing.properties file structure

keyAlias=yourkeyAlias

keyPassword=yourkeyPassword

storeFile=theFileContainingTheKeystore

storePassword=yourStorePassword
0
Leonardo On

To get the solution I just run

keytool -exportcert -keystore ~/.android/debug.keystore -list -v

password: android

Copied SHA-1 and created a new OAuth2 with that hash

Visit: Github reply

0
codrp On

I was using Android Client ID instead of Web Client Id. Once I changed it to webClientId, it worked.

Below is from google developer console, use the client ID from the web client in your Android app.

web client id

0
Preetam Jakhmola On

I think it's a little late to give the answer but still, it will help someone.

You may have not added your release JKS SHA-1 Key in your google cloud console.

just type the keytool command with your release jks path

keytool -list -v -keystore "path to jks file\keystore.jks" -alias release-1

enter image description here

you will get the SHA-1 from here now go to GC console and Create Credentials enter image description here

Now Select your application type and add SHA-1 in the place now Click on Create and it should work.

0
Naga On

The answer above did not work for me, The SHA-1 fingerprint of the sign-in key used during the build process did not WORK, but instead, the key which is provided in Google developer play console under App Integrity->App signing worked, on this page, you will find 2 keys 1 is for use while authenticating with any API vendors and the other one is just a store for the same sign-in key that is used during the build process, this is for the reason in case if we happen to lose the key, should be able to safely download from here. I struggled with this issue for many days and finally resolved it. As the specs keep changing, it's important to look for the latest answers to save us some time. Hope this would help someone before it would no longer work!

enter image description here