Google authentication with GooglePlus plugin not working in Ionic 2 app


#1

I am using GooglePlus from `ionic-native`` library for authentication. But it is not working . The documentation is poor .

 GooglePlus.login( { }, (res) => {
      console.log( res);
    }, (err) => {
      console.log( err);
    } )

this is from https://github.com/EddyVerbruggen/cordova-plugin-googleplus . It it logging just the number 8 to the console. I have no idea , what the hell is going on. I tried GooglePlus.login().then() approach also but same result. What is going on?


#2

Are you already set RESERVED_CLIENT_ID on the config.xml ?

<plugin name="cordova-plugin-googleplus" spec="~5.1.1">
    <variable name="REVERSED_CLIENT_ID" value="xxxxxxxx-xxxx.apps.googleusercontent.com"/>
</plugin>

#3

yes. I have it in my config.xml. And it is not returning any object back, just a number . Dont think its a return value from google api.


#4

Same error here, https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/309


#5

Inorder to obtain the keys from google apis first you need to register you package name in google with SHA-1 … if Debug the path of keystore is different and for release path for keystore will be user defined one. If your SHA-1 is wrong you will get “Error : 12501” …Next you need to add package with reverse client id which should be a Web Application Client Id generated by Google Servers… After building correctly you wll be prompted to choose the gmail in android and based on that you will get id_Token and ServerAuthCode in response. In this way only EddyVerbruggen writtten but for iOS he has writn access_Token which is the main token inorder to access Google’s API services…