This function gets the URL of the icon for a hybrid app depending on whether custom icons are defined.
<static> getAppIconUrl( app, processed ) → {string}
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). |
The URL of the icon.
Type:
string
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 ); }