|
楼主 |
发表于 2016-12-6 22:03:50
|
显示全部楼层
附件是cordova插件。使用时也很简单:
require("cordova!cordova-plugin-ios-keychain");
Model.prototype.keychainonGet = function(getKey){
// this.comp('test3').set({label:"x-gray"});
var self = this;
var key = getKey;
var touchIdMessage = 'TouchID Message';
var win = function(value) {
if (testFlag) console.log("GET SUCCESS - Key: " + key + " Value: " + value);
justep.Util.hint("GET SUCCESS - Key: " + key + " Value: " + value);
};
var fail = function(error) {
if (testFlag) console.log("GET FAIL - Key: " + key + " Error: " + error);
justep.Util.hint("GET FAIL - Key: " + key + " Error: " + error);
};
thiskeychain.get(win, fail, key, touchIdMessage);
};
Model.prototype.keychainonSet = function(inputKey,inputValue){
var key = inputKey;
var value = inputValue;
var useTouchID = false;
var win = function() {
if (testFlag) console.log("SET SUCCESS - Key: " + key);
justep.Util.hint("SET SUCCESS - Key: " + key);
};
var fail = function(error) {
if (testFlag) console.log("SET FAIL - Key: " + key + " Error: " + error);
justep.Util.hint("SET FAIL - Key: " + key + " Error: " + error);
};
thiskeychain.set(win, fail, key, value, useTouchID);
};
Model.prototype.keychainonRemove = function(rmkey){
var key = rmkey;
var win = function() {
if (testFlag) console.log("REMOVE SUCCESS - Key: " + key);
};
var fail = function(error) {
if (testFlag) console.log("REMOVE FAIL - Key: " + key + " Error: " + error);
};
thiskeychain.remove(win, fail, key);
};
|
评分
-
查看全部评分
|