Eugen is a user on mastodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Eugen @Gargron

v2.4.0rc2 is out: github.com/tootsuite/mastodon/

Still some stuff to be done before it can become 2.4.0. In particular, we're adding a webhook-like API so apps can better implement push notifications. This is an extension of the Web Push API we already had implemented, it just needs some cleaning up because previously the events sent through that didn't need to be documented and only the webapp used them.

· Web · 25 · 26

@Technowix Yes, follow @WAHa_06x36 for updates on that, his iOS app "Toot!" is the reason for this implementation

@Technowix @WAHa_06x36 But @tateisu also keeps up with API changes really quickly and I think his SubwayTooter might already be ready to use this new API too.

@Technowix @WAHa_06x36 @Gargron yes, ST2.4.9 supports push subscription (maybe need update access token to enable it). app calls subscription api, then app-server receives notification from mastodon, then event is redirected via Firebase Cloud Messaging that uses mobile network function that can send message to deep sleeped mobile device.
if device has no google servece, ST can use polling notification every 15min interval.

@tateisu @WAHa_06x36 @Gargron Why not keep a sleeping tcp connection like Conversation is doing ?

@WAHa_06x36 @Technowix of course it waste battery. I dont want make battery drainer. also, normally 15min polling is not so bad.

@Technowix @WAHa_06x36 @Gargron if you don't like google service, but is there open alternatives of cloud messaging service? it requires specialized mobile network function. I know amazon kindle has it own messaging service, but it's not open too.

@tateisu @Technowix @Gargron Also, thanks for your little proof of concept decryption code, it helped while I was implementing my own decryption!

@Technowix @Gargron only if they go via google's push notification service :C

@kurisu @Gargron google isn't the only one who can do this :3

@Technowix @Gargron yeah but the app can't connect to mastodon for push itself which defeats decentralisation for mobile.

@kurisu @Gargron well... that the point of the update ?

@Technowix @Gargron what do you mean? It doesn't change anything regarding to that?

@kurisu @Gargron well, any app can maintain a background connection (not anymore on iOS, ok) but on android with the right permission your app can be used in the background , and thus using any "notification provider".

What could be nice is that every Mastodon server actually are relay of some sort, and don't rely on firebase/apple api

@kurisu @Technowix Look up the Web Push API. This is actually standartized. It does require a proxy server between the server and the mobile app, the proxy server works with the google/apple APIs.

@Gargron @Technowix yeah thats exactly what shouldn't be required.

@kurisu @Technowix The reason you can get push notifications in Chrome and Firefox on Android is that Google and Mozilla run such proxy servers. Mozilla's is open-source, called autopush

@Gargron @Technowix yeah but it shouldn't be required and actually isn't required if you use a foreground notification on android.

@kurisu @Gargron the motive behind is "keeping the number of idle connection low" for "saving battery life"

@Technowix @Gargron If you don't understand that you don't understand TCP

@kurisu @Gargron it maintain the phone in a wakeup state.
The way phones work today is kinda different than only on/off state

@Technowix no data being sent down tcp == no packets == no modem usage == no modem wakeups

it's that simple
@Technowix these ios and android restrictions are there ONLY because app devs are incapable of understanding this and keeping their TCP conenctions idle (ABSOLUTELY no data) for minutes on end

@kurisu so how did you get that notification ?

Google's explain on how worked the notification system was kind dumb, it was a pull less and less frequent an really quick since there is only one endpoint to query, and then go back to sleep for sometime

@Technowix well obviously when you want to send a notification then you send data down the socket. But in that case the phone has to wake up to process the notification anyway so it's fine.

@kurisu what I mean is... hum, the state between "I heard" (aka I'm on, aka I'm waked up) and the "I'm not hearing".

You agree that even while keeping an idle tcp connexion (have to maintain it sometime nuh ?) you can't enter in deep sleep for 10min and still receive data in this timestamp ?

@Gargron @Technowix I use an app which stays connected to 6 IRC servers all day on my phone and it's not a huge battery drain.

If mastodon supported a websocket with notifications only there would be no battery drain at all!

@kurisu @Technowix Dude yeah Mastodon has a streaming API. Don't tag me into this pointless argument

@Gargron @Technowix yes but last I heard the home timeline was the same websocket as the notifications websocket so you couldn't get just notifications without the timeline.