Open saiy2k opened 7 years ago
Try to implement the same like this:
import { GooglePlus } from '@ionic-native/google-plus';
constructor(private googlePlus: GooglePlus) { }
...
this.googlePlus.login()
.then(res => console.log(res))
.catch(err => console.error(err));
In ionic 2 maybe windows.[anything].[anything].. dont work anymore(not sure but in new ionic 2 native docs windows.* type syntax is not shown anywhere).
Also make sure use are using these two commands:(just for a confirmation, i know ou must have done this already)
$ ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientid
$ npm install --save @ionic-native/google-plus
use a proper reserved client id. Link to google plus native : https://ionicframework.com/docs/v2/native/google-plus/
Hi,
In my experience, this problem arises when the device doesn't have the google play services updated. Mostly on android 4.x .
Take a look at the logcat while you complete the sign in flow, and see if the message "_Google Play services out of date. Requires XXXXXX but found XXXXXX" appears.
As a workaround I included a dialog with an explanation for the error and a link to update google play services (which is not always searchable on google play btw). And in some cases it did work.
@hackSlanger @gustavo-iniguez-goya Tried both of your solutions, it didn't work.
I cleaned up my code removing unwanted plugins. And Google login worked, when I removed this plugin cordova-plugin-background-mode 0.7.2
specifically.
Will try the same in a Ionic blank project with just googleplus
and background-mode
and report my finding.
just in case you need it, here's the link to the google play services app: https://play.google.com/store/apps/details?id=com.google.android.gms
I'll keep monitorizing this issue to see if you find a solution.
If you are using cordova-plugin-background-mode then add the below in your config.xml
<preference name="AndroidLaunchMode" value="singleTop" />
@hackSlanger i've implemented same as you've mentioned in your answer. still i get null values in familyName and givenName. Also default scopes are profile and email as in google api docs.
is there anything else i'm missing in configuring gplus sign in?
I got the same Google Plus "SignInResult is null" error, yet showing user device google account popup behaviour. in my Ionic v1 app
In my case using Angular Material Library was causing the issue.
Turns out Angular Material has some known integration issues with Ionic. Link below: https://material.angularjs.org/1.1.5/getting-started
i have the same issue with this plugins:
cordova-clipboard 1.3.0 "Clipboard" cordova-custom-config 5.1.0 "cordova-custom-config" cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx" cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter" cordova-plugin-customurlscheme 4.4.0 "Custom URL scheme" cordova-plugin-deeplinks 1.1.1 "Cordova Deeplinks Plugin" cordova-plugin-device 2.0.2 "Device" cordova-plugin-facebook4 6.2.0 "Facebook Connect" cordova-plugin-firebasex 7.0.1 "Google Firebase Plugin" cordova-plugin-googleplus 8.2.0 "Google SignIn" cordova-plugin-inappbrowser 3.2.0 "InAppBrowser" cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 4.1.3 "cordova-plugin-ionic-webview" cordova-plugin-network-information 2.0.2 "Network Information" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-plugin-x-socialsharing 5.6.2 "SocialSharing" cordova-support-android-plugin 1.0.1 "cordova-support-android-plugin" cordova-support-google-services 1.3.2 "cordova-support-google-services" es6-promise-plugin 4.2.2 "Promise" phonegap-plugin-mobile-accessibility 1.0.5-dev "Mobile Accessibility"
Maybe cordova-plugin-inappbrowser cause problem?
PD: It has been impossible for me to put line breaks in the code
I am working on Ionic 2 app and integrated this plugin for Google login.
It works good in my project with the following plugins:
With the same code, it fails with following plugins:
I will narrow down the exact plugin(s), which is causing the issue and update here.
My code is
With the 2nd set of plugins, The login always fails with the following message:
SignInResult is null
The instant the login function is called, error callback is invoked with the msg
SignInResult is null
. But in device, Google account creation popup is displayed and when I tap on my account, neither success callback nor failure callback is invoked.I installed the plugin with following command
ionic plugin add cordova-plugin-googleplus
Posted the same @ http://stackoverflow.com/questions/42813536/error-cordova-plugin-googleplus-signinresult-is-null