Notifiche push

You are not subscribed to push notifications
window.addEventListener('load', function () { if (push_notification.token) { console.log('push_notification_unsubscribe_token_ready no event'); push_notification_unsubscribe(); } else { document.body.addEventListener('push_notification_token_ready', function (e) { console.log('push_notification_unsubscribe_token_ready event'); push_notification_unsubscribe(); }); } function push_notification_unsubscribe() { push_notification_api.get_token_topics(push_notification.token, function (json) { console.log('Push topics a cui sei iscritto:', json.topics); if (json.success && json.topics.length == 0) { document.getElementById('no_push_topics').style.display = 'block'; } else { document.getElementById('unsubscribe_push').addEventListener('click', function () { push_notification_api.replace_topics(push_notification.token, [], function (json) { if (json.success) { AV_Messenger.info(push_notification_frontend_data.translations.push_notification_unsubscribe_title, push_notification_frontend_data.translations.push_notification_unsubscribe_message); document.getElementById('no_push_topics').style.display = 'block'; document.getElementById('unsubscribe_push').style.display = 'none'; } else { AV_Messenger.error(push_notification_frontend_data.translations.push_notification_unsubscribe_title, push_notification_frontend_data.translations.push_notification_unsubscribe_error); } }); }); document.getElementById('push_topics').style.display = 'block'; } }); } });