getAppByID( moduleID, version ) method

Gets a hwc.HybridApp object with the given module id and version.

Syntax

<static> getAppByID( moduleID, version ) → {hwc.HybridApp}

Parameters

Name Type Description
moduleID number The module ID of the hybrid app.
version number The version of the hybrid app.

Returns

The hybrid app object, or null if there is no hybrid app with the given ID and version.

Type:

hwc.HybridApp

Example

// Messages do not have a direct link to the hybrid app they belong to.  Instead they have
// the module ID and version of the hybrid app they belong to.  If you have a message and
// need to access its hybrid app, first you must call hwc.getAppByID.
var messages = hwc.getAllMessages();
if( messages.length > 0 )
{
  var app = hwc.getAppByID( messages[0].getModuleId(), messages[0].getModuleVersion() );
}

Source

hwc-api.js, line 1810.