Client code to send notif - only updating types to allow this.
Added a more general TunnelbrokerNotif union type to avoid extending unions in the callsites.
Depends on D12896
Differential D12897
[lib] Implement sending WebPush notifs using Tunnelbroker bartek on Jul 26 2024, 6:30 AM. Authored by Tags None Referenced Files
Details Client code to send notif - only updating types to allow this. Depends on D12896 Tested together with @kamil, using the following code: const notif: PlainTextWebNotification = { id: uuid.v4(), body: 'body hello', title: 'notif from TB', threadID: '123', }; const tbNotif: TunnelbrokerWebPushNotif = { type: 'WebPushNotif', clientMessageID: uuid.v4(), deviceID: '*******************************************', payload: JSON.stringify(notif), }; try { console.log('starting'); await sendNotif(tbNotif); console.log('done'); } catch (e) { console.log(e); } Successfully received notif on Firefox, Chrome and Safari
Diff Detail
|