Ionic Native GooglePlus无报错静默登录失败问题求助
I’ve been following the official Ionic Google Plus integration guidelines to set up Google login for my app. I’ve created an Android OAuth client in Google Cloud Console, and verified the SHA-1 fingerprint is correct using the command:
keytool -list -printcert -jarfile <path to your apk>
Here’s my login code:
this.googlePlus.login({}) .then(res => console.log(res)) .catch(err => console.error(err));
The problem is that when I run this code, nothing happens—it never enters the then block, nor the catch block, and there are zero errors in the Chrome console.
Relevant Version Info
- Ionic: 3.20.0
- Cordova: 7.1.0
- Ionic Native GooglePlus: 5.3.0
- Android OS: 5.1.1
- cordova-plugin-googleplus: 5.3.0
Other Ionic Native plugins (like Facebook) work perfectly fine. I’ve spent two days troubleshooting this with no luck.
Update 1
I tested modifying the cordova-plugin-googleplus native code to debug the issue. I altered the GooglePlus.execute method like this:
@Override public boolean execute(String action, CordovaArgs args, CallbackContext callbackContext) throws JSONException { this.savedCallbackContext = callbackContext; savedCallbackContext.error(42); action = "abracadabra"; ... // rest of the original code remains unchanged }
After making this change, I can see the error code 42 in the Chrome console. This tells me there's a problem with how the plugin handles errors natively—it's not propagating errors back to the Ionic app properly.
I’m stuck and need technical guidance on how to fix this.
内容的提问来源于stack exchange,提问作者heroin

