this.getIconUrl( processed ) method

Gets the URL of this custom icon.

It is possible to call this function directly, but generally it is easier simply to call hwc.getAppIconUrl or hwc.getMsgIconUrl. Those functions handle both cases where there is and isn't a custom icon for the hybrid app or message.

Syntax

<static> this.getIconUrl( processed ) → {string}

Parameters

Name Type Description
processed boolean When set to true, the URL of the processed icon will be returned. When set to false, the URL of the unprocessed icon will be returned.

Returns

The URL to the target icon.

[/reference/refbody/section/sectiondiv {""})

Type:

string

(sectiondiv]

Example

var apps = hwc.getInstalledApps();
var app = apps[0];
// If app doesn't have a custom icon, then customIcon will be null.
var customIcon = app.getDefaultCustomIcon();
if( customIcon != null )
{
   // Create the image element.
   var image = document.createElement( "img" );
   // Set the source of the image to the icon URL.
   image.setAttribute( 'src', customIcon.getIconUrl() );
   // Add the image element to the page.
   document.body.appendChild( image );
}

Source

hwc-api.js, line 2242.