I followed instructions from https://ionicframework.com/docs/native/google-plus/.
I've created Android Client in https://console.cloud.google.com/apis/credentials/oauthclient using correct SHA-1 (re-checked using keytool -list -printcert -jarfile <path to your apk>
)
Code for login is simple as in instruction:
this.googlePlus.login({})
.then(res => console.log(res))
.catch(err => console.error(err));
However, it never comes into neither then
nor catch
.
No error is displayed in console.
Ionic version 3.20.0
Cordova version 7.1.0
Ionic Native GooglePlus 5.3.0
Android phone version 5.1.1
cordova-plugin-googleplus 5.3.0
I've spent two days, Ionic Native Facebook is working fine, while GooglePlus is just failing silently.
Please advice.
UPDATE 1
It seems to be an issue with cordova-plugin-googleplus
, as when I am changing GooglePlus.execute
to use
@Override
public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException {
this.savedCallbackContext = callbackContext;
savedCallbackContext.error(42);
action = "abracadabra";
... //remains unchanged
then I see in Chrome console 42 - this means, that error handling is not working properly in the cordova-plugin-googleplus plugin.
this.googlePlus.getSigningCertificateFingerprint
- it returns correct value, which is set in Google Console for my android client..then(res => console.log(res))
keep thecatch
as it is ?.catch(err => console.log(err));
?.then(res => console.log(res), error => console.log(error)