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.

var options = {};
options.global = 1; // 1: Value can be read by all microapps. 0: Only to this microapp.

DronaHQ.KVStore.setItem(keyName, keyValue, function() {
        //success callback
}, function() {
        //fail callback
}, options);

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
});