我遇到了这个插件的问题。我正在使用PhoneGap构建一个非离子应用程序。当我第一次实现这个时,我得到一个错误:10但现在没有得到任何警报,但在logcat中,它显示Class not found when unmarshalling
。当我想记录我的webClientId时,我在Success callbackId: GooglePlus1684379192 : ReferenceError: webClientId is not defined
中收到错误。
版本
phonegap version
7.1.1
cordova-plugin-googleplus 5.1.1 "Google SignIn"
代码
window.plugins.googleplus.login(
{
// optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
'webClientId': '52tralalalalalalalalal1l7.apps.googleusercontent.com', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.
'offline': true, // optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server
},
function (obj) {
alert(JSON.stringify(obj)); // do something useful instead of alerting
},
function (msg) {
alert('error: ' + msg);
}
);
window.plugins.googleplus.getSigningCertificateFingerprint(
function (fingerprint) {
console.log('##FINGERPRINT##');
console.log(fingerprint); //prints B0:B9:something:7E:3E
console.log('##webClientId##');
console.log(webClientId); //prints 52tralalalalalalalalal1l7.apps.googleusercontent.com
});
logcat的
我获得Class not found
E/Parcel ( 726): Class not found when unmarshalling: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
E/Parcel ( 726): java.lang.ClassNotFoundException: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
E/Parcel ( 726): at java.lang.Class.classForName(Native Method)
我获得webClientId is not defined
D/SystemWebChromeClient( 4185): file:///android_asset/www/js/my-app.js: Line 2972 : ##webClientId##
I/chromium( 4185): [INFO:CONSOLE(2972)] "##webClientId##", source: file:///android_asset/www/js/my-app.js (2972)
D/SystemWebChromeClient( 4185): file:///android_asset/www/cordova.js: Line 312 : Error in Success callbackId: GooglePlus1684379192 : ReferenceError: webClientId is not defined
I/chromium( 4185): [INFO:CONSOLE(312)] "Error in Success callbackId: GooglePlus1684379192 : ReferenceError: webClientId is not defined", source: file:///android_asset/www/cordova.js (312)