class NotificationAction

Class NotificationAction

Properties

SystemPwaController $mod

Methods

int
clearNotification(array $userIds, string|null $token = null)

No description

int
sendWebPush(string $title, string $message, string $url = null, array $user_ids = null, string $token = null, string $iconURL = null, int|null $ttl = null)

Send Web Push Notification to users Very well supported by Chrome and Firefox.

int
sendWebPushNotification(Notification $notification, string|null $iconURL = null, int|null $ttl = null)

Send Web Push Notification to users Very well supported by Chrome and Firefox.

Details

at line 100
int clearNotification(array $userIds, string|null $token = null)

No description

Parameters

array $userIds
string|null $token

If no token is given, all notifcations are cleared

Return Value

int

Exceptions

ErrorException

at line 74
int sendWebPush(string $title, string $message, string $url = null, array $user_ids = null, string $token = null, string $iconURL = null, int|null $ttl = null)

Send Web Push Notification to users Very well supported by Chrome and Firefox.

Some Support in EDGE and Opera. Little to no support in safari or IE.

Parameters

string $title

Title of the notification

string $message

Message of the notification, should be short!

string $url

URL to open when clicking the notification

array $user_ids
string $token

only the last message per topic should be shown to the user

string $iconURL

Icon should be larger than 128x128 and be of supported type e.g. png,jpg

int|null $ttl

Time in seconds, how long is this message relevant to be displayed to the user?

Return Value

int

Number of Notifications sent

Exceptions

ErrorException
Exception

at line 34
int sendWebPushNotification(Notification $notification, string|null $iconURL = null, int|null $ttl = null)

Send Web Push Notification to users Very well supported by Chrome and Firefox.

Some Support in EDGE and Opera. Little to no support in safari or IE.

Parameters

Notification $notification
string|null $iconURL

Icon should be larger than 128x128 and be of supported type e.g. png,jpg

int|null $ttl

Time in seconds, how long is this message relevant to be displayed to the user?

Return Value

int

Number of Notifications sent

Exceptions

ErrorException