Open nikoladev opened 8 years ago
The callback in this example from the README always sends out the alert that notifications are disabled:
Cocoon.Notification.Local.initialize({}, function(registered) { if (!registered) { alert('Notifications disabled by user') } else { sendNotification(); } })
This is because there's a bug in line 130 of cocoon_notifications.js that ensures that registered is always false: https://github.com/ludei/atomic-plugins-notifications/blob/master/src/js/cocoon_notifications.js#L130
cocoon_notifications.js
registered
false
Until that bug is fixed, this is a workaround that should work:
Cocoon.Notification.Local.initialize({}, function (registered) { Cocoon.Notification.Local.isRegistered(function (granted) { if (!granted) { alert('Notifications disabled by user'); } else { sendNotification(); } }); });
The callback in this example from the README always sends out the alert that notifications are disabled:
This is because there's a bug in line 130 of
cocoon_notifications.js
that ensures thatregistered
is alwaysfalse
: https://github.com/ludei/atomic-plugins-notifications/blob/master/src/js/cocoon_notifications.js#L130Until that bug is fixed, this is a workaround that should work: