cordova-plugin-googleplus icon indicating copy to clipboard operation
cordova-plugin-googleplus copied to clipboard

Consent screen multiple times

Open foses opened this issue 5 years ago • 16 comments

I manage to make it work, but the popup ask multiple times for consent. It ask me for my account, then it close, then ask for consent, then it close, then ask for consent again, then it close and finish.

    this.googlePlus.login(
      {
        'webClientId': [My web client id],
        'offline': true
      }
    )

cordova 9.0.0 ([email protected]) cordova-android 8.1.0 ionic-native/google-plus: 5.9.0

foses avatar Feb 07 '20 17:02 foses

Same issue for me, i also found this stackoverflow thread : https://stackoverflow.com/questions/59908286/why-confirm-your-choices-pops-up-twice-using-cordova-google-plus-plugin/60134209#60134209.

On iOS it is working properly.

Merwan1010 avatar Feb 09 '20 07:02 Merwan1010

Have the same issue. Thanks for reporting.

Chadori avatar Feb 09 '20 08:02 Chadori

Now we have same issue, but this was working perfect some weeks ago.

As a clue to say that this has begun to happen suddenly without any apparent change and only in Android.

Any news about this?

r-rodriguez-s avatar Feb 11 '20 12:02 r-rodriguez-s

Waiting so far.

foses avatar Feb 11 '20 16:02 foses

Same issue here.

"dependencies": { "@angular/common": "^7.2.2", "@angular/core": "^7.2.2", "@angular/fire": "^5.3.0", "@angular/forms": "^7.2.2", "@angular/http": "^7.2.2", "@angular/platform-browser": "^7.2.2", "@angular/platform-browser-dynamic": "^7.2.2", "@angular/router": "^7.2.2", "@ionic-native/core": "^5.0.0", "@ionic-native/google-plus": "^5.19.1", "cordova-android": "8.1.0", "cordova-ios": "^5.1.1", "cordova-plugin-googleplus": "5.2.1", "cordova-support-android-plugin": "^1.0.1", "cordova-support-google-services": "^1.3.2", "core-js": "^2.5.4", },

stefane81 avatar Feb 14 '20 14:02 stefane81

Same issue

IamSurendraThota avatar Feb 17 '20 14:02 IamSurendraThota

try to pass 'offline': false

IamSurendraThota avatar Feb 20 '20 15:02 IamSurendraThota

Passing offline false doesn't solve the issue. The issue still exist. I need to go offlline true so i can request the serverAuth.

foses avatar Feb 20 '20 15:02 foses

Nothing changed for me by setting offline mode to false. The consent pop-up still show twice.

Merwan1010 avatar Feb 21 '20 12:02 Merwan1010

Same issue here. The consent pop-up still show twice.

exequielc avatar Feb 21 '20 13:02 exequielc

The Android Google Client API used in this plugin has been deprecated. I've started to rewrite the Android version to use the newer API.

https://android-developers.googleblog.com/2017/11/moving-past-googleapiclient_21.html

I have it no longer double prompting but I haven't tested it well enough to warrant a pull request.

Edit: Here is my fork/branch https://github.com/joseph-montanez/cordova-plugin-googleplus/tree/android-google-api

joseph-montanez avatar Feb 25 '20 06:02 joseph-montanez

@joseph-montanez Would you please make a Pull Request. Thanks.

Edit: Ah, I see. I'll test your fork later.

Chadori avatar Feb 25 '20 08:02 Chadori

It does not happen on all the versions of Android though, on Android 5 and 6 it works correctly. From 8+ there is an issue. I do not have an Android 7 device anymore to test

mirko77 avatar Mar 03 '20 17:03 mirko77

Try googleplus.login({ offline : false, webclientid: '... ' })

harrowmykel avatar Aug 30 '20 23:08 harrowmykel

Same problem here, the consent screen is shown infinitely even selecting “allow”. The app was working in prod without issues since two years and suddenly stopped working without any change on the code related with the login.

offline: false solves the issue but is not an option because the serverAuthCode is not returned anymore.

Inspected the logcat but there are nothing meaningful.

Any clue on what can be the error?

careduct avatar Oct 01 '20 15:10 careduct

Finally found the issue for our use car (ionic v3), it is related with the @ionic-native/google-plus wrapper of the plugin... What we did to get it back working:

  1. Remove the wrapper: npm uninstall --save @ionic-native/google-plus
  2. Remove all imports you may have and corresponding referencing: import { GooglePlus } from '@ionic-native/google-plus';
  3. add directly the plugin calls via the windows var: declare var window: any; ... return window.plugins.googleplus.trySilentLogin({}, function(res) { ...

For the ones that used promises with the wrapper, be careful because the plugin uses callbacks. Note: we have updated to the last version of the plugin ->8.5.0

careduct avatar Oct 06 '20 21:10 careduct