Replying to Avatar Anthony Accioly

If I'm not mistaken Amethyst has killed push notifications no? Do you really need it? IMO a pull model a la nostr:nprofile1qqsxg45ph8gx0vdrvtzta6xal7v86frx6jvstsnvhrlvtehmwwh4epqprdmhxue69uhkummnw3ezuumpw3ehgunpd35kztnrdakj7qgkwaehxw309amk7apwdehhxarj9ecxzun50yhsz9nhwden5te0v4jx2m3wdehhxarj9ekxzmny9u397edf's Pokey, while not necessarily the most resource efficient way of doing things, is the safest and easiest way to deal with encrypted stuff. IMO, what we need is a "Desktop" or "Browser extension" equivalent of Pokey.

Well, I need this to work on iOS as well. But I'm also a little in the dark about how pokey works (I know next to nothing about android development). Is there a server component, or does pokey just run in the background all the time?

Reply to this note

Please Login to reply.

Discussion

Add iOS to my list above đŸ˜…. In theory, you could also add the background process to Coracle, but I like the idea of doing this externally to clients to avoid duplicated work.

I've already tagged Koala above, as he's much more knowledgeable about all of this than I am. But as far as I understand, it's" just" a background process (easier said than done, given how many kinds need to be supported and fetched from different relays in different ways, including things signed with random keys and non obvious filters) plus Android’s Intent system magic to launch other Nostr apps. Something like Pokey should, in theory, be doable on iOS.

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.

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.