getAppIconUrl( app, processed ) method

This function gets the URL of the icon for a hybrid app depending on whether custom icons are defined.

Syntax

<static> getAppIconUrl( app, processed ) → {string}

Parameters

Name Type Description
app hwc.HybridApp The hybrid app for which the icon URL is desired.
processed boolean Whether to get the URL of the processed icon (true) or the URL of the unprocessed icon (false).

Returns

The URL of the icon.

Type:

string

Example

var apps = hwc.getInstalledApps();
if( apps.length > 0 )
{
   var hybridApp = apps[0];
   // Create the image element.
   var hybridAppIcon = document.createElement("img");
   // Set the source of the image to the icon URL.
   hybridAppIcon.setAttribute( 'src', hwc.getAppIconUrl( hybridApp, false ) );
   // Add the image element to the page.
   document.body.appendChild( hybridAppIcon );
}

Source

hwc-api.js, line 2406.