Key-value storage¶
This family of device APIs allow micro-apps to leverage of the Container App’s secure local storage API. DronaHQ Container App’s secure local storage provides an alternative to the localStorage feature of HTML5. Any value assigned to a key must be of the type string.
Method(s)
Set Item¶
This method allows micro-apps to set a string value to a key.
DronaHQ.KVStore.setItem(keyName, keyValue, function() {
//success callback
}, function() {
//fail callback
});
Get Item¶
This method allows micro-apps to get the string value of a key.
DronaHQ.KVStore.getItem(keyName, function(data) {
//success callback
var value = data.value;
}, function() {
//fail callback
});
Remove Item¶
This method allows micro-apps to remove a key and its associated string value.
DronaHQ.KVStore.removeItem(keyName, function() {
//success callback
}, function() {
//fail callback
});
Clear All¶
This method allows micro-apps to remove all key with their associated string value.
DronaHQ.KVStore.clear(function() {
//success callback
}, function() {
//fail callback
});