如何使用钥匙扣在离子混合移动应用
答
创建一个新的项目并添加这个插件
cordova plugin add https://github.com/shazron/KeychainPlugin.git
而在你的控制器做
module.controller('MyCtrl', function($scope, $cordovaKeychain) {
$scope.getValueFromKey = function(key) {
$cordovaKeychain.getForKey(key, servicename).then(function(value) {
console.log(value);
}, function (err) {
console.error(err);
});
};
});
看看cordovakeychain插件和Git-hub使用它。
科尔多瓦插件添加https://github.com/shazron/KeychainPlugin.git .......这个命令不起作用 –
为我工作。确认您使用的是最新的cordova&ionic –