Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios I';我登录时收到钥匙链错误_Ios_Cordova_Ionic Framework_Login - Fatal编程技术网

Ios I';我登录时收到钥匙链错误

Ios I';我登录时收到钥匙链错误,ios,cordova,ionic-framework,login,Ios,Cordova,Ionic Framework,Login,我已经为此挣扎了很长一段时间,我没有看到隧道尽头的曙光。我正在用ionic开发一个移动应用程序,我想添加一个谷歌登录。就像我在使用firebase一样,我用cordova插件googleplus实现了登录按钮。我开始工作,但最近,在一个干净的状态和重新添加iOS平台后,它停止了工作,在控制台上抛出“keychain error”消息 在安卓系统中,它运行良好;现在,我已经尝试了一切(禁用并重新启用密钥链共享功能,清理所有环境并重建它,检查整个GoogleService-Info.plist,检查

我已经为此挣扎了很长一段时间,我没有看到隧道尽头的曙光。我正在用ionic开发一个移动应用程序,我想添加一个谷歌登录。就像我在使用firebase一样,我用cordova插件googleplus实现了登录按钮。我开始工作,但最近,在一个干净的状态和重新添加iOS平台后,它停止了工作,在控制台上抛出“keychain error”消息

在安卓系统中,它运行良好;现在,我已经尝试了一切(禁用并重新启用密钥链共享功能,清理所有环境并重建它,检查整个GoogleService-Info.plist,检查反向的客户端id…我不知道我缺少了什么)

如果有人能帮我一把,我会非常感激的。提前谢谢

其他一些信息:

Your system information:

Cordova CLI: 6.4.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 1.2.1-nightly-1867
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
ios-deploy version: 1.8.6 
ios-sim version: 5.0.11 
OS: Mac OS X Sierra
Node Version: v4.4.4
Xcode version: Xcode 8.1 Build version 8B62 
已安装的插件:

cordova-plugin-calendar 4.5.5 "Calendar"
cordova-plugin-console 1.0.4 "Console"
cordova-plugin-device 1.1.3 "Device"
cordova-plugin-dialogs 1.3.0 "Notification"
cordova-plugin-fcm 1.1.5 "FCMPlugin"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-inappbrowser 1.5.0 "InAppBrowser"
cordova-plugin-splashscreen 2.1.0 "Splashscreen"
cordova-plugin-transport-security 0.1.2 "App Transport Security"
cordova-plugin-whitelist 1.3.0 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
config.xml文件(其中的一部分):

来自模拟器system.log的一些错误消息:

securityd[16035]: found no keychain client entitlements. task=Xxxxx App[17178]/1#0 LF=0 procid=com.xxxx.xxxx cs_flags=0x22000201
控制器中的登录功能:

  $scope.loginGoogle = function(){
    $ionicLoading.show();
    LogService.log(TAG, 'webClientId : ' + 'XXXXX');
    var clienInfo = {};

    if(ionic.Platform.isAndroid())
    {
      clienInfo.webClientId = 'XXXXXXX';
    }

    window.plugins.googleplus.login(
      clienInfo,
      function (obj) {
        // alert(JSON.stringify(obj));

        LogService.log(TAG, 'googleplus.login result : ' + JSON.stringify(obj));
        LogService.log(TAG, 'obj.idToken : ' + obj.idToken);
        // obj.email          // 'eddyverbruggen@gmail.com'
        // obj.userId         // user id
        // obj.displayName    // 'Eddy Verbruggen'
        // obj.familyName     // 'Verbruggen'
        // obj.givenName      // 'Eddy'
        // obj.imageUrl       // 'http://link-to-my-profilepic.google.com'
        // obj.idToken        // idToken that can be exchanged to verify user identity.
        // obj.serverAuthCode // Auth code that can be exchanged for an access token and refresh token for offline access
        var token = obj.idToken;
        var userData = {
          displayName : obj.displayName,
          avatar : obj.imageUrl,
          currentSessionOn : 'google'
        };
        return AuthService.loginGoogle(token, userData).then(function (result) {
            $rootScope.$broadcast(AUTH_EVENTS.loginSuccess);
            $ionicLoading.hide();
            $state.go('app.tabs.events');
        }).catch(function(error){
            $ionicLoading.hide();
            $scope.message = error.message;
            $timeout(function() {
              $scope.message = null;
            }, 3000);
            $rootScope.$broadcast(AUTH_EVENTS.loginFailed);     
        });
      },
      function (msg) {
        LogService.logError(TAG, 'plugins.googleplus.login error: ' + msg);
        $ionicLoading.hide();
      });
  };

从Xcode启动项目似乎可以解决这个问题。使用Ionic CLI仍然存在此问题


从Xcode启动项目似乎可以解决这个问题。使用Ionic CLI仍然存在此问题


您的问题解决了吗?我也面临同样的问题:/从Xcode启动项目似乎可以解决这个问题。使用Ionic CLI时问题仍然存在。您是否解决了问题?我也面临同样的问题:/从Xcode启动项目似乎可以解决这个问题。使用Ionic CLI时问题仍然存在。我似乎遇到了如上所述的相反问题。当我从ionic serve启动我的项目时,它运行良好(但是我没有使用Cordova插件,而是使用AngularFire2)。但是当我在Xcode中启动这个项目时,我得到了钥匙链错误,我似乎遇到了如上所述的相反的问题。当我从ionic serve启动我的项目时,它运行良好(但是我没有使用Cordova插件,而是使用AngularFire2)。但是当我在Xcode中启动项目时,我得到了钥匙链错误
securityd[16035]: found no keychain client entitlements. task=Xxxxx App[17178]/1#0 LF=0 procid=com.xxxx.xxxx cs_flags=0x22000201
  $scope.loginGoogle = function(){
    $ionicLoading.show();
    LogService.log(TAG, 'webClientId : ' + 'XXXXX');
    var clienInfo = {};

    if(ionic.Platform.isAndroid())
    {
      clienInfo.webClientId = 'XXXXXXX';
    }

    window.plugins.googleplus.login(
      clienInfo,
      function (obj) {
        // alert(JSON.stringify(obj));

        LogService.log(TAG, 'googleplus.login result : ' + JSON.stringify(obj));
        LogService.log(TAG, 'obj.idToken : ' + obj.idToken);
        // obj.email          // 'eddyverbruggen@gmail.com'
        // obj.userId         // user id
        // obj.displayName    // 'Eddy Verbruggen'
        // obj.familyName     // 'Verbruggen'
        // obj.givenName      // 'Eddy'
        // obj.imageUrl       // 'http://link-to-my-profilepic.google.com'
        // obj.idToken        // idToken that can be exchanged to verify user identity.
        // obj.serverAuthCode // Auth code that can be exchanged for an access token and refresh token for offline access
        var token = obj.idToken;
        var userData = {
          displayName : obj.displayName,
          avatar : obj.imageUrl,
          currentSessionOn : 'google'
        };
        return AuthService.loginGoogle(token, userData).then(function (result) {
            $rootScope.$broadcast(AUTH_EVENTS.loginSuccess);
            $ionicLoading.hide();
            $state.go('app.tabs.events');
        }).catch(function(error){
            $ionicLoading.hide();
            $scope.message = error.message;
            $timeout(function() {
              $scope.message = null;
            }, 3000);
            $rootScope.$broadcast(AUTH_EVENTS.loginFailed);     
        });
      },
      function (msg) {
        LogService.logError(TAG, 'plugins.googleplus.login error: ' + msg);
        $ionicLoading.hide();
      });
  };