Provides settings exchange functionality. See also AppSettings.
Methods
(static) disableDataLink(successCallback, errorCallback)
This function disables all types of data (phone numbers, addresses, etc.) in text format to be automatically converted into pressable links,
effectively leaving them as plain text. This is the default setting upon installation of the Settings plugin. If trying to disable an enabled link,
note that this functionality takes effect only after the screen is reloaded.
Only supported on iOS platform, NOT Android.
Only supported on iOS platform, NOT Android.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | Function to invoke if the method is successful. |
errorCallback |
function | Function to invoke if the method failed. |
(static) enableDataLink(successCallback, errorCallback)
This function enables all types of data (calendar events, addresses, etc.) in text format to be automatically converted into pressable links.
Pressing on an enabled link will open the corresponding application (e.g. pressing on an address will open up the map). Note that this functionality
takes effect only after the screen is reloaded.
Only supported on iOS platform, NOT Android.
Only supported on iOS platform, NOT Android.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | Function to invoke if the method is successful. |
errorCallback |
function | Function to invoke if the method failed. |
(static) isFeatureEnabled(name, successCallback, errorCallback)
This function return true if the feature is allowed and false if feature is not permitted.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the feature to fetch. |
successCallback |
function | Function to invoke if the exchange is successful. |
errorCallback |
function | Function to invoke if the exchange failed. |
(static) start(connectionData, successCallback, errorCallback)
Starts the settings exchange.
Parameters:
Name | Type | Description |
---|---|---|
connectionData |
String | This example below shows the structure of the connection data. |
successCallback |
function | Function to invoke if the exchange is successful. |
errorCallback |
function | Function to invoke if the exchange failed. |
Example
connectionData = {
"keyMAFLogonOperationContextConnectionData": {
"keyMAFLogonConnectionDataApplicationSettings":
{
"DeviceType":device.platform,
"DeviceModel":device.model,
"ApplicationConnectionId":"yourappconnectionid"
},
"keyMAFLogonConnectionDataBaseURL":"servername:port"
},
"keyMAFLogonOperationContextApplicationId":"yourapplicationid",
"keyMAFLogonOperationContextBackendUserName":"yourusername",
"keyMAFLogonOperationContextBackendPassword":"password",
"keyMAFLogonOperationContextSecurityConfig":"securityConfigName",
"keySSLEnabled":keySSLEnabled
};
sap.Settings.start(connectionData, function(mesg) {
sap.Logger.debug("Setting Exchange is successful "+mesg,"SMP_SETTINGS_JS",function(m){},function(m){});
},
function(mesg){
sap.Logger.debug("Setting Exchange failed" + mesg,"SMP_SETTINGS_JS",function(m){},function(m){});
});
getConnectionInfo(connectionInfoCallback, errorCallback, forceUpdate)
This function will return the connection information from the server in the first call.
In the subsequent call, the existing connection information will be used, unless a credential update is forced.
Parameters:
Name | Type | Description |
---|---|---|
connectionInfoCallback |
function | A function that will be called with an info object as the parameter. |
errorCallback |
function | A function that will be called with the error object. |
forceUpdate |
boolean | True if a credential update should be performed. False if using the existing connection information is allowed. |
getWhiteList()
This function is used to get the whitelisted urls from the settings plugin.
This function is used when we are trying to check if the url is allowed to reach the plugins or not.