News for hackers. Stuff that matters.
Re:Gotify – a self-hosted push-notifications service by nukeop on Saturday March 09, 2019 @05:23PM (#19348893)
I'm not up to date with Android, but why does displaying notifications require an entire server or a paid service? Is it not just a matter of installing a client program and sending a curl to an endpoint?
Re:Gotify – a self-hosted push-notifications service by johannes1234321 on Saturday March 09, 2019 @05:58PM (#19349082)
You need a way to tell the mobile device that a new message has been received. Since you don't have a fixed IP or anything there is no way to directly send the message.

An alternative is that the mobile device pulls from time to time, but that's quite power intensive or, when using a long interval, is slow.

Instead one has an idle connection open to which the server can send messages.

Re:Gotify – a self-hosted push-notifications service by npmn2 on Saturday March 09, 2019 @05:41PM (#19348996)
It is not needed for displaying the notification but specifically targeting users. You would usually call an FCM function to get a token, which can be used to specifically target that user and is stored in the database. To send a notification to your customised target audience based on user-generated events, it becomes essential to use web-service that does it for you.

For example- Let's say you wish to send a notification to user A when user B sends him a message. In this scenario, you can call another FCM fn, using the token user A had generated. Of course you can use the web dashboard to send the notifications, but in this case, you would not be able to send event-based notification reliability and in real-time. Other services also work in a similar manner.

Re:Gotify – a self-hosted push-notifications service by izacus on Sunday March 10, 2019 @10:48AM (#19352190)
Of course FCM also has notion of channels where you can broadcast to certain topics (which apps listen to) without having to track tokens on application server side.
Re:Gotify – a self-hosted push-notifications service by vageli on Saturday March 09, 2019 @08:08PM (#19349594)
> I'm not up to date with Android, but why does displaying notifications require an entire server or a paid service? Is it not just a matter of installing a client program and sending a curl to an endpoint?

Imagine if every program on the users phone had their own schedule for checking for updates against remote hosts. That sounds terribly inefficient and wasteful of power, as the applications would need to "wake up" (as in, consume processor cycles) to initiate and perform a check.

Re:Gotify – a self-hosted push-notifications service by damian2000 on Sunday March 10, 2019 @08:54AM (#19351740)
Google's solution - Firebase Cloud Messaging is for the most part free and fairly easy to setup. Yes you can use curl to call their HTTP/REST endpoint to send a notification I believe.

If you get to the stage of sending millions of notifications per day then you'll need to start paying,

Re:Gotify – a self-hosted push-notifications service by ktjfi on Saturday March 09, 2019 @07:41PM (#19349501)
Sending a curl to an endpoint from the client is not push but pull. The idea of push notifications is that they arrive immediately.