Vincent Ritter

Gluon - working on cross platform push notifications

One feature that lacks on all third party apps for are push notifications. This is one reason I keep the official client handy.

This has me thinking on the best way to bring this functionality to Gluon, and I’d like to run it by anyone that is interested. This will be for cross-platform support and not only iOS, bringing it to only one would not float well with me.

Local push notifications

One thing that can be done on both iOS and Android is the ability to allow background tasks to run, within reason. I already set wheels in motion to enable this (if you’ve noticed that in the device settings). The latest TestFlight build has the ability to run background tasks, I just haven’t enabled it for anyone and of course you have to opt-in to this anyway.

You generally have the ability to run code and execute it, within a given timeframe, on device. This depends on platform and naturally iOS is way more restrictive, which is a good thing because it makes you think on how to do things more efficiently. The most frequent you can do this is 15 minutes… as long as the app hasn’t crashed or the user force closed it.

Whilst personally I don’t mind if it checks every hour or 2 or 3 or 4 or 5 for mentions, I know that a few people do want it to be a little more frequent than that. So I’ll allow an option for you to choose what suits your needs.

As a default I’ll check every hour. This triggers an API call to to your mentions feed, checks what’s new and advises you accordingly via a local push notification.

This, in my opinion is a great balance between complexity on my end, hassling Manton with more requests to add features to the API, and getting something cross platform with ease.

However, there is another option.

Remote push notifications

This one is more involved and has been already on my drawing board since last year… I just don’t have time to make all this happen though. Gluon makes no income for me, but I’ve been treating it like a full time job...

Long term, if viable, I’d love to remove local push and replace it with remote push notifications. As there is no ability to do anything on the API, for example sending a webhook to a specific client/address, so I would have to do something a bit more clever.

The plan here is to create a small “Gluon API” which acts as a server that checks for mentions at a good interval (every minute or two). Within the app you would be able to register for this service by a tap of a button. Here I would create device specific token to talk to the Gluon API and also pass along the Gluon login token that you get from logging in. I may talk to Manton to see if I can create a new one just for this purpose, so it can be easily revoked.

With this, the Gluon API will start checking your mentions feed. If it finds something it will use the correct push notification server for your registered devices (iOS or Android or both).

With remote push notifications I can make sure not to hammer battery life. Although, the local notifications shouldn’t use too much, but still.

Questions and commitment

The main question, really, is… does it matter that you instantly get a push notification? In my eyes, no. It distracts hugely from the day. I’d rather have one notification with a summary at a particular time of day or at a really slow interval. However everyone is different and uses for different purposes. So it’s difficult for me to judge on how important mentions are to everyone. Gluon is already highly opinionated as it is, although I’m flexible - as you can see with all the settings I’m adding.

In terms of commitment I’m unsure if it’s viable for me to pursue to build an API just for Gluon. I won’t know where will go and what features will be added. At the end of the day it’s not my platform and I’m taking a huge amount of time and effort already to hopefully make Gluon one of the best choices when it comes to third-party apps.