What is Nostr?
calle 👁️⚡👁️
npub12rv…85vg
2024-07-30 07:16:36

calle 👁️⚡👁️ on Nostr: I need help with this! I want to make cashu.me wallet sit in the background and ...

I need help with this! I want to make cashu.me wallet sit in the background and listen for push notifications that are triggered by NWC commands so that the PWA can wake up, send a zap, and go to sleep again.

Who has experience in this? Please hit me up

It asks to enable push notifs, then sends the push endpoint to server along with pubkey and relay, server monitors the pubkey on relay for unanswered nip46 messages, when detected sends a push to wake up the service worker.

Nwc flow is quite similar, so it should be possible to have the same thing there.

Server side is https://github.com/nostrband/noauthd - not a beautiful piece of code, but can be an inspiration.

You'll also need strfry or other relay that stores ephemeral events for a while so that woken up service worker could fetch them.
Author Public Key
npub12rv5lskctqxxs2c8rf2zlzc7xx3qpvzs3w4etgemauy9thegr43sf485vg