I haven't dug into the details on any of this, but the way I understand it is (at least when using FCM) you generate a client-specific token and send it to the push relay, which then sends notifications for all subscriptions by token. So you wouldn't need a relay per client, or per user (unless the user wanted to set up a custom push server).

Reply to this note

Please Login to reply.

Discussion

There are app tokens and API tokens. Google gives your app a specific JSON that ships inside your app to activate push for a valid sequence of tokens. Then there is a token from the device+app that you need to register with a pubkey in your server to know which device+app wants notif from which keys. Your service will have a copy of the API key for your app to tell FCM you are an authorized pusher. Your server then needs to listen to notifications from those keys and send each key to each token. When the notification reaches the phone, the OS knows which app it should send it to.

So, in theory, the server needs the firebase keys of all apps it is pushing notifications for.

Is there a way we can avoid push notification services entirely? Can we replicate something with nostr? As much as I love Apple and Google, I want to be as independent as possible.

Pokey avoids it. But Apple won't allow you to go around itself.

Hmmm... Despite all of Apple’s walled garden limitations, there are unofficial Syncthing clients for iOS, and, somehow, they were approved for Apple's App Store.

https://mobiussync.com/

I think it’s mostly a matter of persistence, lucky and endless patience when dealing with Apple’s “reviewers”. But if folks are able to get a encrypted two-way file sync solution running in the background aproved by Apple, there has to be a way to get something like Pokey approved on iOS.

I didnt know that. Bad example from a technical feasibility PoV then. The point about approvals is still true though.

Just looked at their FAQ. Yeah, whatever they are doing works well for eventually consistent sync, not for potentially time critical notifications:

Background sync

Apple iOS restricts apps from running continuously in the background, but apps can run for short times sporadically. Möbius Sync uses various methods to invoke background behaviour. The minimum interval between quick syncs and power syncs can be configured under Settings, but iOS schedules background activity in an adaptive manner that is not predicatable and sometimes counter-intuitive. It may take 24 hours to start to sync but you can expect a total of 1-2h of sync activity per day once stable.

I agree. In the end, reviewers can allow anything to happen if you have a good reason. :)

Note to self: Avoid Apple.

> Your service will have a copy of the API key for your app to tell FCM you are an authorized pusher.

Ah, there it is. Would it be feasible to just tell relays your app key or would Google ban you for that? Anyway, seems ripe for abuse.

Google is pretty by the book. I remember moving things around in the JSON, and they blocked the release :)

Ah, right, forgot about the walled garden