Nothing is wrong with nsec.app, but it’s suboptimal. It requires a server. iOS is sandboxed and only one app can be in the foreground at a time, so push notifications are needed when a signer request comes in to be able to switch to the signer each time to approve it. It requires nsec.app to be up all the time to be able to sign your events, unless you self-host. One benefit is that you can use nsec.app to approve signer requests that didn’t originate from that same device. nostr:npub1xdtducdnjerex88gkg2qk2atsdlqsyxqaag4h05jmcpyspqt30wscmntxy Please let me know if I interpreted how nsec.app works incorrectly.

My proposal is to have my signer be operational offline, and not need you to switch from your Nostr app to the signer. Everything can be done through the signer action extension in the sheet while the Nostr app is in the foreground the entire time. This would work only for same-device signer requests. It’s a non-optimal UX to do this for each action, but I would also argue that the nsec.app approach is also non-optimal in slightly different ways.

Anyway, iOS makes it difficult to have an on-device signer if you want it to work on the same device as your Nostr app, regardless of approach.

Reply to this note

Please Login to reply.

Discussion

Appreciate your detailed response.

Yes you interpreted nsec.app's architecture right, it depends on a server that detects unanswered requests and sends push notifications to wake up. iOS is actually broken with a PWA, the issue is that PWAs don't receive push messages on time after the last iOS update, which makes nsec.app basically unable to work in the background.

Offline signer like Amber using native inter-app comms is obviously a much better approach, but it doesn't work on iOS or across devices, so if you're using desktop you'll still need something like nsec.app. Confirming every action is a UX nightmare for active daily use - people complain very hard here every time Alby popup shows up without much necessity. I think it's inevitable for iOS to come up with inter-app comms API someday, so maybe all we need is just wait a bit.

It's great that you're exploring options on iOS and I bet there will be useful building blocks created as a result, so please keep doing it and sharing your learnings!

Apple treats remote push notifications as low priority and doesn’t guarantee delivery. It also seems like they will throttle if the app or device exceed limits.

> The number of background notifications allowed by the system depends on current conditions, but don’t try to send more than two or three per hour.

https://developer.apple.com/documentation/usernotifications/pushing-background-updates-to-your-app

We're not using background notifications, we are PWA and are required by browser standards to show the visible notification, which we do. We're not getting _any_ notifications delivered until the PWA is manually launched, at least we didn't the last time we investigated this several months ago. Things worked before the last iOS update (web push was experimental and had to be enabled in iOS settings, but when done - it worked).

Oh weird. Hope Apple fixes it.

I had the issues you describe with nsec.app on iphone 12 mini but on iphone 16 it feels like it works well

You mean it's PWA and working well in the background? Does it show you push notifications?

Yes, the push notifications are how i know its working. With iphone 12 i often had to bring the app to the foreground to get the app to sign

Can you please check which exact iOS version you're running where push are working? Thanks!

I'm on the latest iOS 18.3.

Thanks, will check again!

I think im wrong... the notification appears but the action doesnt happen until i open nsec.app 😔

Hm... that's interesting!