API Reference - WebPortal.notification.new
WebPortal.notification.new
WebPortal.notification.new
Description | This API trigger a WebPortal Notification. Check out the dedicated tutorial. |
Type | postMessage command. See implementation tutorial for post message commands. |
Parameter | Type | Description | Required |
---|---|---|---|
id | String | Id of the notification | True |
body | String | Text of the notification | True |
appId | String | Id of the application. Not generated by app | True |
title | String | Title of the notification (default is app name) | False |
icon | String | App icon in notification center | False |
data | String | Extra custom data, these data will be received in the WebPortal.notification.evt.click | False |
Caution: For accessibility reasons, popup should not be created more often than once every 20 seconds.
1
2
3
4
5
6
7
8
9
10
11
12
13
window.parent.postMessage({
type: "WebPortal.notification.new",
notification: {
/* Required */
id: "unique_id", // String, generated by sender WP App
body: "Charge your car in 15 km", // String
/* Optional */
title: "You have a new message", // String, default: null
icon: "http://.../apps/img.png", // String URL, default: app icon
data: {/* mixed */} // Any, app user data
}
}, '*');
See Also
- Method Create a NC Notification: WebPortal.notification.new
- Event Creation Success: WebPortal.notification.evt.created
- Event Creation Error: WebPortal.notification.evt.error
- Event Prompt Overflow: WebPortal.OverflowPopup
- Event NC Notification Opened: WebPortal.notification.show
- Event NC Notifcation: Open App button clicked: WebPortal.notification.evt.click
- Event NC Notification: Delete button clicked: WebPortal.notification.event.close