Inserisci questo codice nelle pagine dove vuoi permettere agli utenti di attivare le notifiche.
<script src="https://TUO-DOMINIO/api-push/embed-e2ee-basic.js" data-api-base="https://TUO-DOMINIO/api-push"></script>
Sostituisci TUO-DOMINIO con l'URL dove gira Willy Push (es. willypush.it o localhost/Willy_push/httpdocs).
<button onclick="WillyPushE2EE.askPermission().then(function(){alert('Notifiche attivate!');}).catch(function(e){alert(e.message);});">
🔔 Attiva notifiche
</button>
Oppure con segmento (es. per utenti VIP):
<button onclick="WillyPushE2EE.askPermission({role:'vip'}).then(function(){alert('Attivato!');});">
🔔 Notifiche VIP
</button>