Class: Application

Application

An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events.

Methods

(static) getCurrent() → {Promise.<Application>}

Asynchronously returns an Application object that represents the current application

Tutorials:
Returns:
Type
Promise.<Application>

(static) getCurrentSync() → {Application}

Synchronously returns an Application object that represents the current application

Tutorials:
Returns:
Type
Application

(async, static) start(appOptions) → {Promise.<Application>}

Creates and starts a new Application.

Parameters:
Name Type Description
appOptions ApplicationOption
Tutorials:
Returns:
Type
Promise.<Application>

(async, static) startFromManifest(manifestUrl, optsopt) → {Promise.<Application>}

Retrieves application's manifest and returns a running instance of the application.

Parameters:
Name Type Attributes Description
manifestUrl string

The URL of app's manifest.

opts RvmLaunchOptions <optional>

Parameters that the RVM will use.

Tutorials:
Returns:
Type
Promise.<Application>

(async, static) startManyManifests(applications) → {Promise.<void>}

EXPERIMENTAL

Asynchronously starts a batch of applications given an array of application identifiers and manifestUrls. Returns once the RVM is finished attempting to launch the applications.

Parameters:
Name Type Description
applications Array.<ManifestInfo>
Tutorials:
Returns:
Type
Promise.<void>

(async, static) wrap(identity) → {Promise.<Application>}

Asynchronously returns an Application object that represents an existing application.

Parameters:
Name Type Description
identity Identity
Tutorials:
Returns:
Type
Promise.<Application>

(static) wrapSync(identity) → {Application}

Synchronously returns an Application object that represents an existing application.

Parameters:
Name Type Description
identity Identity
Tutorials:
Returns:
Type
Application

addListener(eventType, listener, optionsopt) → {Promise.<this>}

Adds a listener to the end of the listeners array for the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

Called whenever an event of the specified type occurs.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

getChildWindows() → {Promise.Array.<_Window>}

Retrieves an array of wrapped fin.Windows for each of the application’s child windows.

Tutorials:
Returns:
Type
Promise.Array.<_Window>

getGroups() → {Promise.Array.Array.<_Window>}

Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.Windows.

Deprecated:
  • All Window Group APIs will be removed by major version 22.
Tutorials:
Returns:
Type
Promise.Array.Array.<_Window>

getInfo() → {Promise.<ApplicationInfo>}

Retrieves information about the application.

Tutorials:
Returns:
Type
Promise.<ApplicationInfo>

getManifest() → {Promise.<any>}

Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest.

Tutorials:
Returns:
Type
Promise.<any>

getParentUuid() → {Promise.<string>}

Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest.

Tutorials:
Returns:
Type
Promise.<string>

(async) getProcessInfo() → {Promise.<AppProcessInfo>}

EXPERIMENTAL

Retrieves all process information for entities (windows and views) associated with an application.

Tutorials:
Returns:
Type
Promise.<AppProcessInfo>

getShortcuts() → {Promise.<ShortCutConfig>}

Retrieves current application's shortcut configuration.

Tutorials:
Returns:
Type
Promise.<ShortCutConfig>

getTrayIconInfo() → {Promise.<TrayInfo>}

Retrieves information about the system tray.

The only information currently returned is the position and dimensions.

Tutorials:
Returns:
Type
Promise.<TrayInfo>

(async) getViews() → {Promise.Array.<View>}

EXPERIMENTAL

Retrieves current application's views.

Tutorials:
  • Tutorial: Application.getViews
Returns:
Type
Promise.Array.<View>

getWindow() → {Promise.<_Window>}

Returns an instance of the main Window of the application

Tutorials:
Returns:
Type
Promise.<_Window>

getZoomLevel() → {Promise.<number>}

Returns the current zoom level of the application.

Tutorials:
Returns:
Type
Promise.<number>

on(eventType, listener, optionsopt) → {Promise.<this>}

Adds a listener to the end of the listeners array for the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

Called whenever an event of the specified type occurs.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

once(eventType, listener, optionsopt) → {Promise.<this>}

Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

prependListener(eventType, listener, optionsopt) → {Promise.<this>}

Adds a listener to the beginning of the listeners array for the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

prependOnceListener(eventType, listener, optionsopt) → {Promise.<this>}

Adds a one time listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. The listener is added to the beginning of the listeners array.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

(async) quit(forceopt) → {Promise.<boolean>}

Closes the application and any child windows created by the application. Cleans the application from state so it is no longer found in getAllApplications.

Parameters:
Name Type Attributes Default Description
force boolean <optional>
false

Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window.

Tutorials:
Returns:
Type
Promise.<boolean>

registerUser(userName, appName) → {Promise.<void>}

Manually registers a user with the licensing service. The only data sent by this call is userName and appName.

Parameters:
Name Type Description
userName string

username to be passed to the RVM.

appName string

app name to be passed to the RVM.

Tutorials:
Returns:
Type
Promise.<void>

removeAllListeners(eventTypeopt) → {Promise.<this>}

Removes all listeners, or those of the specified event.

Parameters:
Name Type Attributes Description
eventType string | symbol <optional>

The type of the event.

Tutorials:
Returns:
Type
Promise.<this>

removeListener(eventType, listener, optionsopt) → {Promise.<this>}

Remove a listener from the listener array for the specified event. Caution: Calling this method changes the array indices in the listener array behind the listener.

Parameters:
Name Type Attributes Description
eventType string | symbol

The type of the event.

listener function

The callback function.

options SubOptions <optional>

Option to support event timestamps.

Tutorials:
Returns:
Type
Promise.<this>

removeTrayIcon() → {Promise.<void>}

Removes the application’s icon from the tray.

Tutorials:
Returns:
Type
Promise.<void>

restart() → {Promise.<void>}

Restarts the application.

Tutorials:
Returns:
Type
Promise.<void>

scheduleRestart() → {Promise.<void>}

Instructs the RVM to schedule one restart of the application.

Tutorials:
Returns:
Type
Promise.<void>

(async) sendApplicationLog() → {Promise.<LogInfo>}

Sends a message to the RVM to upload the application's logs. On success, an object containing logId is returned.

Tutorials:
Returns:
Type
Promise.<LogInfo>

(async) setAppLogUsername(username) → {Promise.<void>}

Sets a username to correlate with App Log Management.

Parameters:
Name Type Description
username string

Username to correlate with App's Log.

Tutorials:
Returns:
Type
Promise.<void>

(async) setFileDownloadLocation(downloadLocation) → {Promise.<void>}

Sets file auto download location.

Parameters:
Name Type Description
downloadLocation string

file auto download location

Tutorials:
Returns:
Type
Promise.<void>

(async) setJumpList(jumpListCategories) → {Promise.<void>}

Sets or removes a custom JumpList for the application. Only applicable in Windows OS. If categories is null the previously set custom JumpList (if any) will be replaced by the standard JumpList for the app (managed by Windows). Note: If the "name" property is omitted it defaults to "tasks".

Parameters:
Name Type Description
jumpListCategories Array.<JumpListCategory> | null

An array of JumpList Categories to populate. If null, remove any existing JumpList configuration and set to Windows default.

Tutorials:
Returns:
Type
Promise.<void>

(async) setShortcutQueryParams(queryString) → {Promise.<void>}

Sets the query string in all shortcuts for this app. Requires RVM 5.5+.

Parameters:
Name Type Description
queryString string

The new query string for this app's shortcuts.

Tutorials:
Returns:
Type
Promise.<void>

setShortcuts(config) → {Promise.<void>}

Sets new application's shortcut configuration. Windows only.

Parameters:
Name Type Description
config ShortCutConfig

New application's shortcut configuration.

Properties
Name Type Attributes Description
desktop boolean <optional>

Enable/disable desktop shortcut.

startMenu boolean <optional>

Enable/disable start menu shortcut.

systemStartup boolean <optional>

Enable/disable system startup shortcut.

Tutorials:
Returns:
Type
Promise.<void>

setTrayIcon(icon) → {Promise.<void>}

Adds a customizable icon in the system tray. To listen for a click on the icon use the tray-icon-clicked event.

Parameters:
Name Type Description
icon string

Image URL or base64 encoded string to be used as the icon

Tutorials:
Returns:
Type
Promise.<void>

setZoomLevel(level) → {Promise.<void>}

Sets the zoom level of the application. The original size is 0 and each increment above or below represents zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively.

Parameters:
Name Type Description
level number

The zoom level

Tutorials:
Returns:
Type
Promise.<void>

terminate() → {Promise.<void>}

Closes the application by terminating its process.

Tutorials:
Returns:
Type
Promise.<void>