关注Javascript:
WORKING
//Going to set on local storage on an iPhone
window.localStorage.setItem("emailaddress", "test@test.de");
//Loading local storage
var storage = window.localStorage.getItem("emailaddress");
alert(storage); //test@test.de
var servicename = "test";
window.plugins.keychain.getForKey(storage, servicename);
不工作
//Going to set on local storage on an iPhone
window.localStorage.setItem("emailaddress", "test@test.de" + ":1");
//Loading local storage
var storage = window.localStorage.getItem("emailaddress");
var array = new Array();
var array = storage.split(":");
var emailaddress = array[0];
alert(emailaddress); //test@test.de
var servicename = "test";
window.plugins.keychain.getForKey(emailaddress, servicename);
为什么呢?实际上我需要第二个,因为我想存储多个电子邮件地址,例如emailaddress / state / timestamp ....