1 | /** |
2 | * @param { Uint8Array } applicationServerKey |
3 | */ |
4 | export async function suscribeAPush(applicationServerKey) { |
5 | // Recupera el service worker registrado. |
6 | const registro = await navigator.serviceWorker.ready |
7 | return registro.pushManager.subscribe({ |
8 | userVisibleOnly: true, |
9 | applicationServerKey |
10 | }) |
11 | } |