Replying to Avatar calle

nostr:npub1xdtducdnjerex88gkg2qk2atsdlqsyxqaag4h05jmcpyspqt30wscmntxy what black magic did you use to make nsec.app so incredibly persistent in the background when installed as a PWA? Can you help me make cashu.me as persistent as nsec.app so I can make NWC zaps while the wallet is closed / in the background?

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.

Reply to this note

Please Login to reply.

Discussion

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

nostr:nevent1qqs86ydcrey0ykkruevc00wzp2ce2m63yn5yhuftks4ssqt0amlvaqgpremhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet59upzqv6kmesm89j8jvww3vs5pv46hqm7pqgvpm63twlf9hszfqzqhz7aqvzqqqqqqyxqvy4n