News for hackers. Stuff that matters.
Re:Pidgin – A Universal Chat Client by sneak on Friday January 22, 2021 @11:17AM (#25872939)
iOS applications aren't allowed to stay awake constantly talking to a bunch of different network services.

For iOS IM to work, a centralized server (and corresponding developer ID) has to send a notification to you, sent first to Apple to be proxied via Apple's push notification service (APNS) to which each iOS device maintains a persistent connection.

This means that some third party service has to know when you get a message (and thus needs to proxy your connections to the IM services, and know your credentials and see your message contents) to be able to know when to send that notification.

This (and Signal now replacing the cryptographically shattered iMessage) is probably the main reason I'm switching to Android; truly decentralized/private notifications aren't really possible on iOS. They have to come from the app developer's own 24/7 online servers, sent from them to you via Apple servers, which means that federated stuff is basically out without providing your login details to the developer (which of course lets them see all your messages). This is also why almost no ActivityPub/fediverse clients can notify you of DMs on iOS either if you run your own instance.

I know there's Background App Refresh now that lets apps wake up periodically to download stuff; I'm not sure if such polling can fire off notifications from the local app. It's probably too much latency for IM, however, due to the fact that Background App Refresh isn't (last I looked) allowed to run continuously (for battery reasons).

Re:Pidgin – A Universal Chat Client by wruza on Friday January 22, 2021 @12:21PM (#25873724)
You don’t have to put an entire message text into APNS notification. Apple (and google GCM, and webpush) notifications only deliver a structured event to the application (which may or may not contain any text), and once the app is activated (if not yet), it has to connect to its own server to get a full representation of what was sent, update vv-status, etc. APNS/GCM are not instant messengers on their own, though may be used as such in simple cases.

the main reason I'm switching to Android

You may be interested in reading this comment then: https://www.reddit.com/r/signal/comments/ap9lin/comment/eg7v...

Likely, iOS version of Signal uses the same “empty ping” technique, so you don’t have to worry about Apple reading your texts, unless you’re concerned with metadata leak. But unless they’re spoofing a websocket with fake packets, it will leak anyway.

Re:Pidgin – A Universal Chat Client by sneak on Friday January 22, 2021 @10:55PM (#25879477)
Sure, but there still needs to be a server somewhere that has the app developer's client certificate, connected to Apple, that knows when you get a DM and can send that zero-content "wake up and check your DMs" packet to your phone via APNS, which means it needs (given current apps permissions models) access to your DMs without you.
Re:Pidgin – A Universal Chat Client by wruza on Saturday January 23, 2021 @04:27AM (#25880912)
There is no need for this “server somewhere”, and APNS can’t have your message, mainly for two reasons:

First, that “server” is Signal server itself. When a message arrives at it, it simply commands Apple to wake up your app, for it to call home, and that’s it. It is preconfigured to do that (and GCM as well).

Second, all Signal messages are end to end encrypted and neither of Apple, Signal, Google, your ISP, any server on the route of it NEVER know its content, because the only mean of decrypting it resides in a memory of your client app. There is basically no way to see the contents before your client receives the message, by design. Even if that were not the case, various IM servers don’t have to send your texts to Apple, only if they want the text to be shown on a notification itself.

The only theoretical concern here may be that Apple can somehow pick the decryption key out of the app’s memory (because ios is a supervisor, obviously). But that can’t be the main reason someone swithces to android, which is a supervisor itself, and where the same issue exists.

Re:Pidgin – A Universal Chat Client by sneak on Saturday January 23, 2021 @11:03AM (#25883186)
We're talking about federated/decentralized protocols that Pidgin serves as the type of client for, in a thread about why we don't see things like Pidgin on iOS.

In a centralized system where the mobile app is made by the same people as the IM server, of course the IM server can send a notification to the app (such as is done in e2e stuff like Signal, or in non-e2e such as Telegram).

That falls apart when you're talking about, say, ActivityPub on an instance you run yourself, or one not operated by the vendor of the IM app. The developer's server can't know when to send you a notification without having some knowledge, from your own e.g. IRC, ActivityPub, or Matrix server, that you have received a new DM.

The Matrix/Element people have addressed this by running one centralized notification service for every single client of the Matrix/Element iOS app.

Re:Pidgin – A Universal Chat Client by wruza on Saturday January 23, 2021 @10:39PM (#25888943)
We're talking about federated/decentralized protocols that Pidgin serves as the type of client for, in a thread about why we don't see things like Pidgin on iOS.

Sorry, I misunderstood that.

Re:Pidgin – A Universal Chat Client by _-___________-_ on Saturday January 23, 2021 @03:52AM (#25880756)
It doesn't need access to the content of the messages.
Re:Pidgin – A Universal Chat Client by sneak on Saturday January 23, 2021 @11:04AM (#25883199)
Sure, but it needs to know that there are new messages. I don't think that's a separate permission on any (e.g.) ActivityPub/XMPP/IRC server implementation today.
Re:Pidgin – A Universal Chat Client by _-___________-_ on Saturday January 30, 2021 @09:35PM (#25975211)
On all XMPP server implementations I've worked with, the push notifications mechanism supports (and usually defaults to) not including any message body in the API call to the push server. Usually it's also possible to leave out the sender name/JID, e.g. with prosody's mod_cloud_notify.
Re:Pidgin – A Universal Chat Client by novok on Friday January 22, 2021 @12:04PM (#25873490)
You can create local notifications any time your app is active, which includes the background. AFAIK signal does empty APNS push to wake and then pulls data with it's own connection and then displays text content with a local notification.

The main reason for the restriction to apple-only for notification services is battery life, and they've been proven right by bad behavior demonstrated on android.

Interestingly, if your a VOIP app you can actually circumvent a lot of the background networking restrictions, but it's still hard to do when you don't have an active call in place. You also have to be an actual VOIP app to get approved with that entitlement. Which wouldn't be hard to get approval for if you made a fork of signal for example, since it does have real VOIP capabilities inside.

Either way the battery life of your device would be worse with your custom VOIP app always keeping a connection open vs. apple's native OS notification system.

Re:Pidgin – A Universal Chat Client by lxgr on Friday January 22, 2021 @12:09PM (#25873574)
> Interestingly, if your a VOIP app you can actually circumvent a lot of the background networking restrictions

These APIs were removed a while ago. As an example, pure SIP clients (without a SIP<->APNs proxy operated by the app developer) are no longer possible for iOS.

Re:Pidgin – A Universal Chat Client by lxgr on Friday January 22, 2021 @12:08PM (#25873548)
> This (and Signal now replacing the cryptographically shattered iMessage) is probably the main reason I'm switching to Android

Android seems to be headed the opposite direction from Apple when it comes to background service execution and network connectivity. I wouldn't be surprised if background network connections are the next thing to go.

> which means that federated stuff is basically out without providing your login details to the developer

It's definitely possible to support federated push, although it's admittedly more work for app/protocol developers: The app developer would have to set up a "push proxy" server that accepts push notifications addressed to a specific iOS device.

It would be nice if Apple was to allow optional sourcing of "anonymous" pushes for such use cases, but that doesn't seem to be in line with their desired level of control.

Re:Pidgin – A Universal Chat Client by richardwhiuk on Friday January 22, 2021 @12:12PM (#25873605)
Android is heading in the same direction with GCM.
Re:Pidgin – A Universal Chat Client by lxgr on Friday January 22, 2021 @03:34PM (#25876029)
Exactly, maybe I was unclear: Apple has been adding more and more background execution modes to iOS over the years, while Google has been steadily removing them from Android (and nudging developers towards GCM instead).
Re:Pidgin – A Universal Chat Client by 0xffff2 on Friday January 22, 2021 @12:48PM (#25874073)
>cryptographically shattered iMessage

Could you expand on this? I did a quick search but I don't see anything relevant that's more recent than 2016.

Re:Pidgin – A Universal Chat Client by maqp on Saturday January 23, 2021 @03:58AM (#25880786)
See my comment from 2019 https://news.ycombinator.com/item?id=21425897

It's still relevant.

Re:Pidgin – A Universal Chat Client by srgpqt on Friday January 22, 2021 @01:16PM (#25874370)
iCloud backups contain iMessage encryption keys so the messages can be decrypted and read by Apple.