Webportal v1

embedded apps

API Reference - WebPortal.notification.new

WebPortal.notification.new

Type Method
Min Privacy Full

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