GCM push notifications are deprecated. wrtc_kit does not support push notifications at the moment.
wrtc.onNotifications() is an event function called when user or browser has allowed or blocked notifications.
First time wrtc.adv.startPushNotifications() is called web server will ask user to allow notifications:
After user clicked on "Allow" or "Block" wrtc.onNotifications() will be called with the results as argument.
All future wrtc.adv.startPushNotifications() calls will be answered by browser itself without asking user again. The browser remembers the user's choice. After browser allows or blocks request wrtc.onNotifications() will be called with the results as argument.
User or browser has allowed or blocked notifications.
wrtc.onNotifications(arg)
Ignored.
If user has blocked notifications in browser, javascript code cannot enable it again. Thus if wrtc.onNotifications(false) occurs we need to instruct user how to manually allow notifications again:
wrtc.onNotifications = function(success) {
if (!success)
window.alert("Notifications are blocked by browser. To enable them again please click on padlock icon in browser address field and select Notifications: Always allow on this site.");
}