Skip to content

Application

The Application.app file is a JSON file that contains the MDK app definition.

Application Properties

Property Type Required
EditorSetting EditorSetting Optional
Localization I18n Optional
MainPage Page Required
OnDidUpdate ActionOrRule Optional
OnExit ActionOrRule Optional
OnLaunch complex Optional
OnLinkDataReceived ActionOrRule Optional
OnReceiveFetchCompletion ActionOrRule Optional
OnReceiveForegroundNotification ActionOrRule Optional
OnReceiveNotificationResponse ActionOrRule Optional
OnResume ActionOrRule Optional
OnSuspend ActionOrRule Optional
OnUnCaughtError ActionOrRule Optional
OnUserSwitch ActionOrRule Optional
OnWillUpdate ActionOrRule Optional
Styles Style Optional
Version string Optional
_Name string Required

EditorSetting

Name and Path of the reference application.


Localization

Refers to any file underneath the project root's i18n folder that has a .properties extension.

Localization Example

"/_Name/i18n/i18n.properties"

MainPage

Refers to a file underneath the project root's Pages folder that has a .page extension.

MainPage Example

"/_Name/Pages/SomePage.page"

OnDidUpdate

A .action or .js file that runs with the new definitions recieved from the update. If rejected/fails, revert to previous definitions. PLT formatter is supported.


OnExit

This event is raised when the app is about to be exited. PLT formatter is supported.

OnExit Example

"$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnExitIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnExitAndroid.action')"

OnLaunch

This event is raised when the app is launched and when user has onboarded, entered demo mode or entered passcode. PLT formatter is supported.

  • type: complex

OnLaunch Value

Any following options needs to be fulfilled.

Option 1

Option 2

Array type:

All items must be of the type:


OnLinkDataReceived

A .action or .js file that when the app is launched from an external link (deeplink). The data for the url: mdkclient://sap.com?ProductId=123 is stored in json format as {URL: 'sap.com',Parameters: {ProductId: '123'},URLScheme:'mdkclient'} and can be accessed via clientAPI.getAppEventData() function PLT formatter is supported.


OnReceiveFetchCompletion

A .js file that is triggered when a remote notification arrived that indicates there is data to be fetched. For iOS, the request contains { "apns.contentAvailable": true }. For Android, the request does not contain any notification section. PLT formatter is supported.


OnReceiveForegroundNotification

A .js file that is triggered when a notification is about to be presented to the app. PLT formatter is supported.


OnReceiveNotificationResponse

A .js file that is called to let your app know which action was selected by the user for a given notification. PLT formatter is supported.


OnResume

This event is raised when the application is resumed after being suspended, for example, when the app comes back to the foreground. PLT formatter is supported.

OnResume Example

"$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnResumeIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnResumeAndroid.action')"

OnSuspend

This event is raised when the application is suspended, for example, when the app goes into the background. PLT formatter is supported.

OnSuspend Example

"$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnSuspendIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnSuspendAndroid.action')"

OnUnCaughtError

This event is raised when an uncaught app error is present. PLT formatter is supported.

OnUnCaughtError Example

"$(PLT, '/MDKDevApp/Actions/PLTActions/AppEvents/OnUncaughtErrorIOS.action','/MDKDevApp/Actions/PLTActions/AppEvents/OnUncaughtErrorAndroid.action')"

OnUserSwitch

This event is raised when the user is switched in Multi-User mode and all the pending Offline OData transactions from previous user are successfully synced.


OnWillUpdate

A .action or .js file that runs with the existing definitions prior to update. PLT formatter is supported.


Styles

The Styles metadata provides the client with a LESS style file used to style the controls. These are also known as built-in controls.


Version

A string, .global or .js file that returns a string representing the version of updated metadata.

  • type: string

_Name

Name of the app to be used as the base in definition reference. No space and symbols are allowed

  • type: string

Examples

// Application.app
{
  "_Name": "MDKApp",
  "MainPage": "/MDKApp/Pages/Menu.page",
  "OnLaunch": "/MDKApp/Actions/CreateService.action",
  "OnUnCaughtError": "/MDKApp/Actions/DisplayErrorMessage.action",
  "OnExit": "/MDKApp/Rules/AppExit.js",
  "OnWillUpdate": "/MDKApp/Rules/OnWillUpdate.js",
  "OnDidUpdate": "/MDKApp/Rules/OnDidUpdate.js",
  "OnSuspend": "/MDKApp/Rules/OnSuspend.js",
  "OnResume": "/MDKApp/Rules/OnResume.js",
  "OnLinkDataReceived": "/MDKApp/Rules/OnLinkDataReceived.js", 
  "Styles": "/MDKApp/Styles/Styles.css",
  "Version": "/MDKApp/Rules/MetadataVersion.js",
  "Localization": "/MDKApp/i18n/i18n.properties",
  "OnReceiveForegroundNotification" : "/MDKApp/Rules/ForegroundNotificationEventHandler.js",
  "OnReceiveFetchCompletion" : "/MDKApp/Rules/ContentAvailableEventHandler.js",
  "OnReceiveNotificationResponse" : "/MDKApp/Rules/ReceiveNotificationResponseEventHandler.js",
  "OnUserSwitch": "/MDKApp/Actions/DisplayUserSwitchMessage.action"
}