问题
I am using this plugin : https://github.com/EddyVerbruggen/cordova-plugin-googleplus
I am trying to check as soon as my app opens if the user is already logged in or not. However i am getting an error error : 4.
Also which variable I need to use to check that user is already logged in or not does this code returns something for this?
window.plugins.googleplus.trySilentLogin({
'scopes': '',
'offline': true
},
function(obj) {
alert(JSON.stringify(obj));
alert('YES GOOGLE LOGGED IN');
},
function(msg) {
//outputs error : 4
alert('GOOGLE LOGIN error: ' + msg);
}
);
UPDATE :
However, the
window.plugins.googleplus.login
method works without any issue but the trySilentLogin gives this error code : 4.
UPDATE 2 :
In my app just for testing, first I called login method it returned me the token, then after that i called the trySilentLogin, it also returned me the token, but when i do vice-versa, i.e. first time i call trysilentLogin without calling login method then it says error : 4 and then in next call i called the login method which also gave error : 4
来源:https://stackoverflow.com/questions/49662677/phonegap-google-login-plugin-issue-error-4