It's so insane to me that the only way to do push notifications on Android is to link whatever server is producing your actual push notifications to a Google Firebase middleman that will receive the notifications and republish them and then you have to put a special manifest file in your Android app that tells Google that your app is listening to that certain Firebase a middleman — as in, you don't even listen to that Firebase middleman yourself in any piece of code anywhere in your app, the operating system it completely handles it for you. IT is what listens for those push notifications and wakes your app up to deal with them. Which is why you can't just directly use whatever server is producing its own push notifications (which it would have to be to make the Firebase push notification middleman work anyway), because at no point do you actually have control over how you subscribe to push notifications in your code, and Android only supports Firebase.
And of course, even though there is a widespread and well-known push notifications standard that web push notifications use, so even if Google didn't want you to handle listening for notifications in your own code for maybe OS scheduler optimization reasons they could still make it so that you could tether your app to any server that produces pushed notifications as long as they follow that standard, they limit it to only working with Firebase.
And the kicker is that theoretically you could just set up a long running background process for your application that survives reboots and closing the app and stuff and it could just sit in the background and listen to push notifications or a websocket or whatever, like on Linux or old Android, but Android has made the OS increasingly hostile to that in the interest of battery life and performance optimization to try to keep up with Apple. There's still technically a way to do it and that's what I plan to do — I plan to massively abuse the multi-threaded asynchronous foreground worker system — but this is a really atrocious.