I read pokey's readme and played around with it, it does look like a background process. Which is great for user security, but not so much for battery use, multi-device, or UX simplicity.

Reply to this note

Please Login to reply.

Discussion

As a user, battery use is negligible.

Yeah, I agree, there are trade-offs here. UX itself isn't too bad (although clients do lose a bit of flexibility for sure). But given the alternative is to trustanother third-party, I still prefer the pull model.

Folks running their own relays could potentially run an "aggregator" + push server. I already though about building something like this, but I don't see many users setting that up, nor clients willing to support this to be honest. Maybe in the future, side quest n 788.

I guess I could also just imitate pokey and do the same background processing in Flotilla directly. But the limitations just seem so severe. From perplexity:

- Android allows background services, but recent OS versions (Android 8/Oreo and above) impose strict limits on background processing to save battery life.

- Foreground services can run persistently but must display a notification, which is not ideal for most user experiences.

- Periodic background work can be scheduled using WorkManager, but the frequency is limited and not real-time.

No, please don't do that. If all apps are running in the background, there won't be enough battery. Pokey should do that for you and pass the event to your app for display.

Even with background workers? I'm trying to design something for normies without pokey, obviouspy if they have pokey installed that would be preferable. Is there a way to detect if pokey is installed?

Yep. Pokey has a lot of trouble staying alive already. If we have too many of these background apps, the OS will just start killing them randomly.

If you do this, I would try to build an external reusable component for iOS. That way you will "solve" the problem for other clients as well.

IMO, despite all of the limitations mentioned above, I've become a fan of Pokey. To the point that I've disabled most of 0xChat notifications that use the push model.

It isn't perfect by any means, especially given what you want to do that involves decrypting NIP-17 with random keys. But it works well enough. IMO, better than a lot of clients with full blown push servers, custom notification relays, etc.

I've been using pokey since day 1. It uses almost no battery, it's always <1% in my battery stats. Essential Android Nostr software.