Skip to main content

overwolf.notifications API

Use this API to send toast notifications from your OW app.

Toast are interactive OS notifications that lets you create flexible "reminders" with text, images, and buttons/inputs. Toast notifications are a combination of some data properties like header, visual (hero image, inline image, app logo) and the toast content.

Note that currently using toast on an unpacked app does NOT work.

Methods Reference

Events Reference

Types Reference

showToastNotification(args, callback)

Version added: 0.176

Show Windows toast notification.

ParameterTypeDescription
argsToastNotificationParams objectToast notification params
callback(Result: ShowToastNotificationResult) => voidReturns with the result

Usage example

// Replace {EXTENSION-ID} with your extension's id, and the image paths with paths to the actual images you wish to display
overwolf.notifications.showToastNotification({
header: "Header",
texts: ["text1", "text2", "text3"],
logoOverride: {
url: "overwolf-extension://{EXTENSION-ID}/84x84.png",
cropType: overwolf.notifications.enums.AppLogoCrop.Default
},
heroImage: "overwolf-extension://{EXTENSION-ID}/logo_364x180.png",
inlineImage: "overwolf-extension://{EXTENSION-ID}/logo_364x180.png",
attribution: "sent from an app",
buttons: [
{
id: "button_1",
text: "button 1"
},
{
id: "button_2",
text: "button 2"
}
]
}, console.log);

The above line of code triggers this notification:

notification-example

ToastNotificationParams Object

ParameterTypeDescription
headerstringSee notes
textsstring[]Mandatory. See notes.
logoOverrideLogoOverride objectSee notes.
heroImagestringSee notes.
inlineImagestringSee notes
attributionstringSee notes
buttonsToastNotificationButton[]See notes.

header notes

You can provide a headline to the notificaiton.

texts notes

Texts parameter must exist and include 1-3 texts (lines).

logoOverride notes

By default, your toast will display your app's logo. However, you can override this logo with your own image.

heroImage notes

Toasts can display a hero image, which is displayed prominently within the toast banner and while inside Action Center. Image dimensions must be 364x180 pixels.

inlineImage notes

You can provide a full-width inline-image that appears when you expand the toast.

attribution notes

If you need to reference the source of your content, you can use attribution text. This text is always displayed at the bottom of your notification, along with your app's identity or the notification's timestamp.

buttons notes

Buttons make your toast interactive, letting the user take quick actions on your toast notification without interrupting their current workflow. Buttons appear in the expanded portion of your notification.

ToastNotificationButton Object

ParameterTypeDescription
idstring
textstring

LogoOverride Object

Note: Must be 364x180.

ParameterTypeDescription
urlstring
cropTypeAppLogoCrop enum

ShowToastNotificationResult Object

ParameterTypeDescription
successbooleaninherited from the "Result" Object
errorstringinherited from the "Result" Object
idstring

AppLogoCrop enum

Version added: 0.176

Specify the desired cropping of the image.

OptionValueDescription
Default"Default"Cropping uses the default behavior of the renderer.
None"None"Image is not cropped.
Circle"Circle"Image is cropped to a circle shape.

onToastInteraction

Version added: 0.176

Fired when a user tapped on the body of a toast notification or performed an action inside a toast notification, with the following structure: ToastNotificationEvent Object.

ToastNotificationEvent Object

ParameterTypeDescription
idstring
eventTypeToastEventType enum
buttonIDstring
errorstring
errorCodeToastEventError enum

ToatsEventType enum

Version added: 0.176

Describes the toast event type.

OptionValueDescription
Dismiss"dismiss"
ButtonClick"buttonClick"
Error"error"

ToastEventError enum

Version added: 0.176

Describes the toast event error.

OptionValueDescription
Unknown"unknown"
NotificationsDisabled"notificationsDisabled "
Error"error"