Used to access SMP application settings. See also Settings.
Methods
(static) clearCache()
Synchronously clears any cached Settings data.
(static) getApplicationEndpoint(successCallback, errorCallback)
Retrieves the application end-point with which the application can access business data.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | Called with the value of the ProxyApplicationEndpoint. |
errorCallback |
function | Called with error object that contains status and statusText. |
Example
sap.AppSettings.getApplicationEndpoint(function(endpoint) {
console.log("Endpoint: " + endpoint);
}, function(error) {
alert("Failed to get setting. Status code" + error.statusCode + " text: " + error.statusText);
});
(static) getConfigProperty(successCallback, errorCallback, name)
Retrieves a config property by name.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | Called with the value of the property. |
errorCallback |
function | Called with error object that contains status and statusText. |
name |
string | The property name |
Example
sap.AppSettings.getConfigProperty(function(token) {
console.log("DeviceToken: " + token);
}, function(error) {
alert("Failed to get setting. Status code" + error.statusCode + " text: " + error.statusText);
}, "ApnsDeviceToken");
(static) getConfigPropertyMap(successCallback, errorCallback)
Returns all the settings in Name-Value pairs.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | Called with object that contains a collection of name value pairs. |
errorCallback |
function | Called with error object that contains status and statusText. |
Example
sap.AppSettings.getConfigPropertyMap(function(properties) {
for (var name in properties) {
console.log("Property Name: " + name + " value: " + properties[name]);
}
}, function(error) {
alert("Failed to get settings. Status code" + error.statusCode + " text: " + error.statusText);
});
(static) setConfigProperty(nameVals, successCallback, errorCallback)
Updates the provided Name-Value pairs of config properties.
Parameters:
Name | Type | Description |
---|---|---|
nameVals |
object | Object that contains name value pairs. |
successCallback |
function | Called if set is successful. |
errorCallback |
function | Called with error object that contains status and statusText. |
Example
sap.AppSettings.setConfigProperty({ "ApnsDeviceToken" : "mytoken" }, function() {
console.log("Device token set");
}, function(error) {
alert("Failed to set setting. Status code" + error.statusCode + " text: " + error.statusText);
});