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
OnReceiveFetchCompletion ActionOrRule Optional
OnReceiveForegroundNotification ActionOrRule Optional
OnReceiveNotificationResponse ActionOrRule Optional
OnResume ActionOrRule Optional
OnSuspend ActionOrRule Optional
OnUnCaughtError 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.


OnExit

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


OnLaunch

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

  • type: complex

OnLaunch Value

Any following options needs to be fulfilled.

Option 1

Option 2

Array type:

All items must be of the type:


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.


OnReceiveForegroundNotification

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


OnReceiveNotificationResponse

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


OnResume

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


OnSuspend

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


OnUnCaughtError

This event is raised when an uncaught app error is present.


OnWillUpdate

A .action or .js file that runs with the existing definitions prior to update.


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", 
  "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"
}