Notification
Posted: Fri Sep 14, 2018 2:42 pm
just a snippet...
Code: Select all
Procedure ShowNotificationCallback()
Debug "ShowNotificationCallback()"
EndProcedure
Procedure ShowNotification(Title.s, Message.s, Icon.s = "", Callback = #PB_Ignore)
! if (!Notification) {
Debug "This browser doesn't support desktop notification"
! return;
! }
! if (Notification.permission !== "granted") {
! Notification.requestPermission();
! } else {
! var notification = new Notification(v_title, { icon: v_icon, body: v_message, });
If Callback <> #PB_Ignore
! notification.onclick = function () { v_callback() };
EndIf
! }
EndProcedure
ShowNotification("Notification title",
"This is a simple desktop notification",
"http://icons.iconarchive.com/icons/paomedia/small-n-flat/64/cat-icon.png",
@ShowNotificationCallback())