首页 文章

成功登录后没有来自cordova-plugin-googleplus插件的回调

提问于
浏览
2

在我的离子应用中使用cordova-plugin-googleplus的Google plus登录给了我一个问题 . 登录后,不会调用成功回调 .

window.plugins.googleplus.login(
        {
            'scopes': 'email profile', 
            'webClientId': '**********', 
            'offline': true, 
        },
        function (obj) {
            alert('login success');
            //... user service called

        },
        function (msg) {
            alert('error: ' + msg);
        }
    );

在上面的代码段中,都没有调用警报 . 当我检查adb logcat日志时,我发现登录成功:

D/CordovaActivity( 1614): Incoming Result. Request code = 77552
    D/CordovaInterfaceImpl( 1614): Sending activity result to plugin
    I/GooglePlugin( 1614): In onActivityResult
    I/GooglePlugin( 1614): One of our activities finished up
    I/GooglePlugin( 1614): Handling SignIn Result
    I/GooglePlugin( 1614): trying to get account information
    W/CordovaPlugin( 1614): Attempted to send a second callback for 
    ID: *************
    W/CordovaPlugin( 1614): Result was: {**** correct user info ****}

另外有趣的是,window.plugins.googleplus.trySilentLogin工作正常 . 我正在使用android物理设备,还有facebook插件等 .

任何解决这个问题的指针都会很棒 .

1 回答

  • 0

    我使用这个插件,刚刚删除

    'webClientId': '**********',
    'offline': true,
    

    所以插件是有效的 .

相关问题