updateIconData Procedure

You can implement a plugin to update the appearance of its button (or multiple buttons at once to make it look the same) on My Route without closing the plugin page or interrupting its background operation.

The procedure has only the parameter iconData that is mandatory and has the same format as the iconData field for the close, sleep, and initEnd messages.

The iconData parameter lets you control:
  • Button color
  • Display text
  • Custom image

Plugin button appearance is independent of the activity icon design on the My Route page. Standardized activity icons introduced in the application UI do not affect how plugin buttons are rendered or customized using this procedure.

Example of the callProcedure message with the updateIconData procedure:
{
    "apiVersion": 1,
    "method": "callProcedure",
    "procedure": "updateIconData",
    "callId": "123abc",
    "params": {
        "iconData": {
            "color": "highlight",
            "text": "117",
            "image": new Blob([
                '<?xml version="1.0"?>' +
                '<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" viewBox="0 0 64 64">' +
                    '<rect x="16" y="16" width="32" height="32" fill="#fff" />' +
                '</svg>'
            ], { type: 'image/svg+xml' });
        }
    }
}