Hacker News new | ask | show | jobs
by sneak 745 days ago
The Vector people who develop Matrix run a centralized server with APNS client certificates (from Apple) that allow them to push notifications to every single Matrix iOS user when they receive messages. This centralized server is a notification proxy for all iOS users that use that client.

With federated systems, notifications are a big problem on iOS because the apps don't actually get to run in the background in the traditional sense. They can periodically "refresh", or they can be opened by a user, or they can be woken up by a notification. Notifications can only come from Apple, and can only come via Apple from the app's developer.

Even selfhosted Mattermost pushes notifications to users via the Mattermost organization's centralized APNS notification proxy. It's an annoying form of phone-home, and I think it may even leak message content to the publisher (because the notifications can contain message data).

If you self-host an XMPP server, you can't get realtime notifications of messages on iOS unless you have the app actively open and foregrounded so the app itself can maintain a connection to the server. The moment (or, actually, 15-20 seconds later) you lock your device, poof goes the connection.

XMPP is not end to end encrypted, and is a dying (and weird) protocol. If you're going to selfhost anything, Matrix (via dendrite or synapse or whatever the current state of the art is) is probably the correct answer.

2 comments

Your perception of XMPP is over a decade out of date. XMPP has push notifications and end-to-end encryption in all the modern apps.

You're quite right that a situation such as you describe (requiring the app to be open to receive messages) would be a horrible experience. Support for push notifications was a solved problem years ago.

There is no way for your selfhosted xmpp server to deliver notifications to an iPhone unless you are the publisher of the xmpp client app you use (which requires doxing yourself to Apple and paying $99/year if you don’t want to sign new binaries every week).

The server support is irrelevant; this is an iOS/APNS issue.

The notifications are relayed via a server run by the app developer, who pays the fee and has the key.
fwiw Element and Element X support UnifiedPush & ntfy on Android these days, so you can avoid routing everything via FCM/GCM/C2DM or whatever Google's push system is called these days. There isn't an equivalent on iOS yet though, so if you want to use your own push server, you have to build your own IPA.