Open-Source Push Notification Microservice: Easy Setup, Ready to Use reddit / selfhosted ---------------------------------------------------------------------- andrei_ncs · 2023-11-20 15:38 I want to introduce you to a new open-source project we've been working on for the past year or so - a **Push Notification Microservice**. This microservice is designed to provide a straightforward, ready-to-use solution for sending push notifications to iOS and Android devices via Firebase. Some key aspects of this microservice include: * **Ease of Setup:** It's built to be user-friendly, enabling you to run it in less than 30 minutes. * **Open-Source Flexibility:** The code is available for anyone to fork, modify, and use without limitations. * **Serverless Infrastructure:** Developed on top of AWS CDK, the microservice leverages cloud-native technologies for high scalability and reliability. * **Comprehensive Features:** Includes everything needed for push notification management, from user and device ID handling to detailed logs and push notification inbox functionality. This tool can be a valuable asset for developers looking for an efficient way to manage push notifications in their projects. Your feedback and contributions are welcome, as they help us improve and evolve the service. Check it out and let us know what you think: [https://github.com/HyperSense-Software/agnostic-push-notification- microservice](https://github.com/HyperSense-Software/agnostic-push- notification-microservice) I am looking forward to your thoughts and feedback! ---------------------------------------------------------------------- ElevenNotes · 2023-11-20 15:48 You lost me at Firebase. ---------------------------------------------------------------------- andrei_ncs · 2023-11-20 15:56 Sorry, I was referring to Firebase Cloud Messaging (FCM). ---------------------------------------------------------------------- ElevenNotes · 2023-11-20 15:58 You lost me at *insert any google product*. ---------------------------------------------------------------------- j0nathanr · 2023-11-20 18:54 Firebase is pretty much essential for push notifications on mobile devices (without constantly polling and burning battery life). Even using web push, most browsers use firebase under the hood. I don't like it anymore than you, but it's certainly not OP's choice ---------------------------------------------------------------------- SpecificProfession49 · 2023-11-20 19:00 So no third party service needed??? I was thinking this was a requirement for iOS. Am I wrong ? ---------------------------------------------------------------------- ElevenNotes · 2023-11-20 19:09 I doubt native iOS apps or the OS is using firebase from Google but okay 😅 ---------------------------------------------------------------------- andrei_ncs · 2023-11-20 19:31 There is also the option of implementing them natively, but Firebase provides additional tools like Analytics, batching, handling of expired tokens, and so on. At our company, Firebase is the go-to solution for push notifications. We might consider implementing a version that connects straight to Apple and Google without Firebase if needed. ---------------------------------------------------------------------- andrei_ncs · 2023-11-20 19:32 You need to configure Firebase Cloud Messaging (FCM). Sending push notifications to iOS and Android can also be done without FCM by directly connecting to Apple's and Google's servers. We might consider releasing a more "barebone" version at some point in the future. ---------------------------------------------------------------------- SpecificProfession49 · 2023-11-20 19:33 Thank you! Going to check this out. ---------------------------------------------------------------------- YaZasnyal · 2023-11-20 21:13 iOS now supports web push so no third party tools are required. But requires the site to be a PWA and to be installed. ---------------------------------------------------------------------- virgoerns · 2023-11-20 21:25 I'm using ntfy for selfhosted push notification service so it's certainly not true that FCM is the only option. It uses ~1% of battery each cycle and I can send push notifications to my phone with curl. How cool is that? More examples. FairEmail uses Push-IMAP (which is different technology than Push notifications, but visible effect is the same) and it doesn't even show in battery stats. Conversations IM (XMPP client) used their own implementation of polling which didn't show in battery stats as well. Maintaining idle TCP connection costs virtually nothing in terms of battery life when implemented right. See also: https://unifiedpush.org/ ---------------------------------------------------------------------- j0nathanr · 2023-11-20 21:39 I also use NTFY it's lovely. The last I looked at their documentation though, it most certainly uses FCM. Sure you have the option of not using it, but then you won't receive push notifications when the app is closed or in the background. Web push works, but your simply relying on your browsers backend for notifications (which is usually FCM) ---------------------------------------------------------------------- acidobinario · 2023-11-20 22:28 Last time I looked at ntfy, the FCM was an optional configuration "Using Firebase is optional and only works if you modify and build your own Android .apk. For a self-hosted instance, it's easier to just not bother with FCM." Using websockets in my selfhosted ntfy service almost doesn't affect the battery performance on my devices. ---------------------------------------------------------------------- adamshand · 2023-11-21 00:34 Sadly, I believe web push notifications still go through a centralised server provided by the browser developer. ---------------------------------------------------------------------- This-Gene1183 · 2023-11-21 03:47 FYI, Downvoting you. ---------------------------------------------------------------------- This-Gene1183 · 2023-11-21 03:48 Can you make it a docker container? ---------------------------------------------------------------------- ElevenNotes · 2023-11-21 04:50 Amazing. ---------------------------------------------------------------------- Schokkohu · 2023-11-21 06:14 What’s the benefit or difference compared to ntfy? ---------------------------------------------------------------------- andrei_ncs · 2023-11-21 09:10 We'll consider it, thanks for the idea. It might take us a couple of months to get there. ---------------------------------------------------------------------- andrei_ncs · 2023-11-21 09:16 It is similar and some ways, but this microservice is only built for deployment on AWS via AWS CDK. There's also zero plans of monetizing it in any way. You can five it a try or just look over its code. We would be more than happy to receive your input. ---------------------------------------------------------------------- YaZasnyal · 2023-11-21 09:47 It would be very wasteful to deliver them directly. In this architecture every app has to manage connections and this is not good for battery powered device. It also allows to unload apps from the memory but still get the notifications. Using apple servers is not that bad after all. If you care about privacy than you can use encryption. The message is delivered to the service worker that can decrypt them. ---------------------------------------------------------------------- ProfessionalAd3026 · 2023-11-21 17:05 While you have your reasons to downvote, it would benefit us all, if you explain them. ---------------------------------------------------------------------- adamshand · 2023-11-21 18:50 I understand why, I just wish there was a way to do notifications without a centralised, internet connected server. One of the things I do is build communications systems for scientific crews who are often working in places with local wifi but no internet. They'd really like to have a Matrix server (or similar) they can use to send each other messages. But as far as I've been able to determime this is currently impossible. :-( Deltachat is the best solution I've been able to find. ---------------------------------------------------------------------- braverthanbrave · 2023-11-22 17:30 That’s not true. Firebase is not required for iOS push notifications. ---------------------------------------------------------------------- andrei_ncs · 2023-11-22 19:17 Unfortunately, it's not feasible to send traditional push notifications on a local network since they rely on Apple's and Google's servers. However, a workable alternative involves having mobile apps run in the background. This is straightforward on Android and, while more challenging on iOS, it's certainly achievable. By connecting these background-running apps to a broadcasting server using a socket connection, you can facilitate the exchange of messages between the server and the mobile app. Consequently, the apps can generate local notifications. These local notifications have the same appearance and functionality as standard push notifications, providing a similar user experience without the need for external server dependencies. ---------------------------------------------------------------------- adamshand · 2023-11-22 23:12 Yeah, but there aren't many apps which do this. DeltaChat is the most promising since it gets notifications directly via IMAP, but I haven't yet tested how well it actually works.