If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

To save the local variables throughout your application, AMM uses Local Storage. Examples used in AMM are displayed below. These variables are editable and can be configured to meet your organization's requirements.
Local Storage Declaration:

var Storage = {
UserID: "UserID",
LinkID: "LinkID",
DisplayName: "DisplayName",
TokenID: "TokenID",
UserName: "UserName",
UserPassword: "UserPassword",
RememberMe: "RememberMe",
FavEvent: "FavEvent",
FavSession: "FavSession",
ActiveFeed: "ActiveFeed",
ResultPerPage: "ResultPerPage",
EventsPastYearCount: "EventsPastYearCount"
};


Note: This should be mainly declared in aptify.mobile.settings.js file

How to create Local Storage Variables?


The below is a generic method used to create Local Storage:

function CreateLocalStorage(key, value) {
if (typeof (localStorage) == 'undefined') {
alert(ErrorMessages.LocalStorageSupport);
}
else {
try {
localStorage[storageAppKey + key] = value;
}
catch (e) {
if (e == QUOTA_EXCEEDED_ERR) {
alert(ErrorMessages.LocalStorageQuotaExeed);
}
}
}
}
The given code is to create the Local Storage by calling the above method.
e.g. key= Storage.EventsPastYearCount and value="1"
CreateLocalStorage(Storage.EventsPastYearCount, 1);


The generic method given below is used to read the Local Storage:

function ReadLocalStorage(key) {
if (localStorage == undefined) {
alert(ErrorMessages.LocalStorageSupport);
return false;
}
else {
return $.trim(localStorage[storageAppKey + key]);
}
}


e.g.
ReadLocalStorage(Storage.EventsPastYearCount)
The generic method below is used to delete the Local Storage:

function DeleteLocalStorage(key) {
delete localStorage[storageAppKey + key];
}
The given code is to delete the Local Storage by calling the above method.
e.g.
DeleteLocalStorage (Storage.EventsPastYearCount)


An Application key is mainly used to differentiate between two applications running on the same domain.
Application Key: var storageAppKey = "AMM";
Note: This should be mainly declared in aptify.mobile.settings.js file.

  • No labels