14 ms·
Fuck Cloud Messaging
- ocdtrekkie 6y agoThis is one of those subtle ways the Play Store protects its monopoly. Sure, you technically can install an app without using Google Play Services, but notifications won't work.
- throwaway8941 6y agoHow do Chinese users get around this problem? I don't have Play Services on my phone and Telegram notifications work just fine (because it keeps its own background connection anyway). Maybe they're reinventing the wheel in every application like Telegram does?
- k__ 6y agoI have to admit, for most apps I'm happy that it won't work...
- onli 6y agoBut to not be misleading, that does not mean you will not get notifications in apps that need them. The F-Droid version of Telegram will still notify you when someone writes you, and mail programs will still show a notification about incoming mail. There are alternative solutions. And there is microG, to hook into the Google way of doing things.
- 3np 6y agoThis is the most significant hurdle to do proper decentralized smartphone applications today. Me and some friends were sketching on something that could be used for grassroots movements and peer-to-peer marketplaces - push notifications is the one thing making it practically untenable.
- valuearb 6y agoOpen source a push server, boom, problem solved.
- 3np 6y agoUnless there's something I'm completely unaware off, there's still no way to make that work without root (Android) or jailbreak (iOS).
- valuearb 6y agoYou can connect your third party push server to APNS no problem, it’s fine all the time.
- snthd 6y agohttps://gotify.net https://gotify.net > A self-hosted push notification service.
- asdfasgasdgasdg 6y agoI still see apps that poll from time to time. Most of them require keeping a notification active to prevent their service from getting shut down. Surely under such a regime you could send a "push" notification to the phone. Not sure how easy it is to listen on android though.
- zaptrem 6y agoDoesn't Android have a local notification function like iOS does?
- asdfasgasdgasdg 6y agoAs in, you can pop up a notification from local events? It did several years ago the last time I programmed on it. I'd be surprised if it didn't today. But a poll->local notification isn't technically a push notification.
- throwaway8941 6y agoIt does. You have to keep one running (with it being impossible to dismiss) if you want to prevent your application from being shut down. That's what GP is talking about.
- asdfasgasdgasdg 6y agoTo be fair I believe you can now "mute" these permanent notifications and you still get the same user experience, although with an extra step.
- codegladiator 6y agoI really dislike the "to save the battery" reason. Lets also disallow games to save the battery ?
- bstar77 6y agoThis is not a great analogy... Games require your immediate attention so you know why you are killing battery life and accept that fact. Services that run in the background are invisible and will drain your battery over time. In some cases this is normal required behavior, but if everyone were to have their own background process running your device would become useless very fast. These seemingly draconian policies have to protect likely outcomes as well as edge cases.
- valuearb 6y agoWe are talking about background execution time. That’s something that is hidden from users, they put their phone in their pocket and two hours later their battery charge is substantially diminished. They don’t understand why or how to stop it. They know playing a game for hours straight reduces battery charge.
- codegladiator 6y agoOkay, I get it, author provides another analogy as well thogh, probably more apt. Their own location services.
- valuearb 6y agoNo they didn’t. Location services are a necessary part of being a phone. It’s called cell tower triangulation and your phone needs to do it constantly, or you can’t receive or send calls.
- mindslight 6y agoYou're posting shallow dismissals while seemingly having no idea what you're talking about. The complaint about location in the article is about Google's tendency to bug you to turn on GPS and leave it on, happily draining the battery but for Google's own surveillance purposes. Having a GPS fix is not a requirement of the cell network. Cell tower triangulation is something the network can do as a result of your phone connecting to cell towers. While connecting to a cell tower is mandatory for cell communication, an open baseband could make it a point to only connect to one tower at a time (although a single tower will still have some location information due to sector antennas).
- jitl 6y agoOn the other hand, when I used Android (2010s), I remembered using tools that required root – or even custom OS builds – just so I could prevent apps (like Facebook) from running in the background and draining my battery doing who-knows-what network activity. In this case, I much prefer today's heavy-handed platform restrictions on background processes to yesteryear's permissive but perpetual battery-drained Android ecosystem. Edit: the article references this HN thread, which I'm sure we'll end up rehashing: https://news.ycombinator.com/item?id=22310319 https://news.ycombinator.com/item?id=22310319
- deleted 6y ago[deleted]
- umvi 6y agoSurely they could have put in a switch in a sub sub sub menu that allows the user to still have the freedom to have apps with background processes though? The thing I hate is megacorps slowly infringing and removing device/OS freedoms in the name of some stated "good cause" (security, malware prevention, battery life, etc.).
- jitl 6y agoThere is such a setting: https://support.google.com/pixelphone/thread/6068458?hl=en https://support.google.com/pixelphone/thread/6068458?hl=en Although perhaps it is not respected correctly by the OS?
- anthropodie 6y agoI have had this enabled for KDEConnect in past but it still used to fail.
- valuearb 6y agoI don’t see the authors point, battery life is important. A phone is not a Unix server or a desktop PC. This is the same reason iOS doesn’t allow apps to have arbitrary background execution time. And phones know your location virtually 100% of the time because of cell tower triangulation. That’s part of being a phone, not a google hypocrisy.
- swiley 6y agoYou can leave a socket open in the background (although you do need a periodic keep alive but the period can be pretty long.) to receive push messages without draining the battery (as long as the server doesn’t spam it.). The real problem is pushing everyone towards unconfigurable closed software that would otherwise abuse full access to the device. Because people can’t trust what they run on their phones the apps can’t be given any more privileges than a random web page.
- oneplane 6y agoPeople can't trust it anyway because most people are not developers, programmers or able to read code, debug binaries or even have a concept of hardware and software.
- swiley 6y agoThe solution on more open OSes is to require apps to publish their source code and engage with the developer community before making them easily installable. (Ex: most Linux distributions)
- oneplane 6y agoSolution to 'what' exactly? Unless you require all users to also be software engineers before they are allowed to buy a device that's not really solving anything, is it? Shifting the point of trust around changes nothing, and you can't shift it to the users because they are users, not developers.
- cocktailpeanuts 6y agoIt's funny how he's even imagined implementing his own push server. Only because Android. On iOS people have already taken for granted that you must go through APNS. Also, this is not just about push. The problem is that Apple and Google de facto own the edge user interface: phones.
- swiley 6y agoIt doesn’t have to be this way. You can buy pine phones now and they actually work.
- oneplane 6y agoBut does it work at scale and with the UX of the other platforms? If so: why hasn't it taken off yet? The technical part is not the hardest part; it's the "everything else".
- swiley 6y agoPersonally I don’t like the UX of other platforms at all so I don’t see why that’s a requirement. It hasn’t taken off yet because it’s only barely started shipping.
- packetlost 6y agoOne of my friends has one of these and says it's horribly unstable and the LTE usually doesn't work. I imagine there's still a lot of work to be done to make it usable for technical people, much less non-technical people.
- cocktailpeanuts 6y agoIt doesn't have to be, but it is.
- toast0 6y agoIt's because Apple's contract with developers was always a tightly limited execution context, sometimes things get added or taken away, but the shape is the same. Background execution was originally forbidden and is now tightly regulated. Android has moved from a mostly unrestricted environment to one that's pretty restrictive. Which means things have been taken away, and things that would have worked in gingerbread can't work today. And it's big things with reasonable use cases too: background exection and network access used to be pretty reliable (minus wifi tended to turn off with the screen), now it's not --- if Google push doesn't work, no notifications until the user starts the app or Google lets you run; you used to be able to use a usb camera from an app, now you can't with latest Android, so keep an old phone for inspection cameras. I understand unfetered background execution is problematic, but it's also useful.
- BlueTemplar 6y agoCan't we move to IPv6 where there is no NAT ?
- WarOnPrivacy 6y agoNot if you have an ISP, that won't ever support IPv6. There are a lot of us (in the US) in that boat. It's hard to play with unavailable tech. edit: removed stuff about Push via SIP, that might be too incorrect to be helpful. Also removed some pondering about trying msg.exe over IPv6. I was probably fishing for trouble there.
- BlueTemplar 6y agoThey're going to have to move to IPv6 : with Europe running out of IPv4 addresses, and a lot of third-world countries never having had enough of the in the first place, soon enough an IPv4-only connection won't be considered a real Internet connection any more...
- WarOnPrivacy 6y agoThey're not. Over 10 years, our ISPs went from "imminent deployment" to "looking into it" to "what is IPv6?". In 2030 we won't have native IPv6 and it won't be on the drawing board.
- jlokier 6y agoThis is mostly about mobile devices, where IPv6 and/or avoiding NAT don't solve the main problems. You'd need mobile IPv6, and background applications that don't get killed while listening to a socket. As far as I know, neither of those are commonly available.
- maxbaines 6y agoVia a PWA seems like the Notification API works with no 3rd party https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API https://developer.mozilla.org/en-US/docs/Web/API/Notificatio...
- gruez 6y agoAren't they stilled routed over FCM?
- maxbaines 6y agoNo, the Push API is a Web Standard https://www.w3.org/TR/push-api/ https://www.w3.org/TR/push-api/
- gruez 6y agoIt's a standard, but it still requires a push service, aka FCM. It's not like the web browser is listening on an open port and the server is connecting to it. eg. if you go to https://gauntface.github.io/simple-push-demo/ https://gauntface.github.io/simple-push-demo/, you can see that the endpoint is fcm.
- jlokier 6y agoThat's just an API, and doesn't say which push service will be used. FCM could be used potentially. However, the Push API refers to a recommended IETF protocol for providing the push service: https://tools.ietf.org/html/rfc8030 https://tools.ietf.org/html/rfc8030
- swiley 6y agoThis is for locally generated notifications only. Push messages are different, last time I checked Mozilla operates a free service to relay push notifications.
- maxbaines 6y agoI suppose the OP should comment, but I read that although local push was tried there was a wider view about using walled services. the Push API does solve that.
- swiley 6y agoApple is even worse. There is a singular service, there’s, and using it costs $100/year. Rate doesn’t matter ... and Mozilla can run theirs for free. I’m just glad my pinephone shipped and everything on my phone actually makes sense now (even if I have to compile things and write a few config files.)
- valuearb 6y agoIt’s one of the reasons a billion iOS devices have good battery life.
- swiley 6y agoAn alternative is requiring developers to engage with the community and convince them there’s no ill intent. And where is the option for those of us who don’t mind less battery in exchange for actually getting prompt notifications for services we use?
- valuearb 6y agoThe option is called jail breaking. Apple has an obligation to its customers to make their phones work as well as possible. Customers complain all the time about mysterious battery draining behaviors, and blaming various apps. Having millions install some cool new notifications service without realizing it’s actually a battery draining service just multiplies those problems.
- yepthatsreality 6y ago> Having millions install some cool new notifications service without realizing it’s actually a battery draining service just multiplies those problems. This is pure FUD reasoning though. You can’t say “no you can’t have that because it could possibly be bad trust me” without any evidence that it would be a major issue. The more locked down a phone is the more people need Apple/Google.
- 6y ago
- YarickR2 6y agoAnother pointlessly aggressive rant. Like it or not, FCM provides unified push mechanism, aggregating communications for every app using it and ensuring least resource usage . Open Push, or whatever it would be, will need to make sure all apps used same server(s) and, preferably, single connection kept alive, otherwise some apps will get notifications , others wont, and it will be seemingly random.
- WilTimSon 6y agoIt's currently on the main page of Hacker News with 61 points and lots of attention turned to it. Sadly, as long as people find this needlessly aggressive tone appropriate, we'll keep seeing this kind of stuff everywhere. It's like clickbait, fewer people would click on this if this was titled 'I have some issues with cloud messaging', I know I wouldn't.
- amar-laksh 6y agoEver tried to send a push notification to your phone? How hard can it be? - At least locally, KDE Connect(https://kdeconnect.kde.org/ https://kdeconnect.kde.org/) got you covered.
- anthropodie 6y agoIt doesn't allow you to send custom notification though. I am using GSConnect on desktop btw.
- fcm_throwaway 6y agoOne of the more insidious things Google has done here is that they force you to use the Firebase SDK to implement Cloud Messaging / Push Notifications. This SDK has "Google Analytics for Firebase" enabled by default, and they use dark patterns to make it seem like having Analytics enabled is required: https://imgur.com/a/Nk2KhFo https://imgur.com/a/Nk2KhFo Of course, if you do enable analytics, then Google sucks up your customer data (including in-app purchase behavior!) for their own data collection and advertising purposes. Also, you're required to tell your users this is happening, but of course developers don't know this. (More dark patterns in how Google reveals that they steal your analytics data for themselves: https://imgur.com/a/R0K71Zn https://imgur.com/a/R0K71Zn)
- risyachka 6y agoAs far as I know to add Analytics to your mobile project you need to explicitly do that in Android studio or Xcode. Enabling it in your project like you show on the screen does basically nothing as long as you don't have analytics SDK in your app.
- fcm_throwaway 6y agoWhen you go to add the SDK, Analytics gets added by default. The setup flow makes it seem to be required. But also the previous screens (when creating a Firebase account) appear to imply that Cloud Messaging won't work correctly without analytics. https://imgur.com/a/Fl919Wm https://imgur.com/a/Fl919Wm
- risyachka 6y ago> For an optimal experience with Firebase Cloud Messaging, we recommend enabling Google Analytics in your project This is stated right before the steps you show. Only the one who doesn't read will blindly add analytics.
- walterbell 6y agoIs there a review/reputation database for APIs & SDKs, where this type of information can be syndicated to developers? Can also be distributed via doc browsers like Dash, e.g. if censored from the web.
- ogre_codes 6y ago> Instead, they have this warped reasoning where they don't allow any program to run in background, except theirs, "to save the battery". Looking at the landscape of shit software out there, I find this justification entirely plausible. If iOS & Android didn't lock this down, phones would be running 4-5 different poorly implemented push platforms (or more). Battery performance on mobile would be utter crap. There is a big balancing act going on here. People want phones that do the thing they are supposed to do. They also want battery life to be excellent and the device to be secure by default. It's impossible to give 3rd party devs 100% access and meet those 2 demands.
- Angostura 6y agoI imagine without restrictions on background working most people's phones would be busily mining cryptocurrency by now.
- hal9000-tng 6y agoWhy couldn't the OS simply surface a push notification of its own, that app X is consuming lots of CPU?
- yencabulator 6y agoAnd have such malware figure out the threshold, and throttle themselves just slightly under it.
- wayneftw 6y agoThen give us a control to adjust the threshold.
- stevenwliao 6y agoHow many end users prefer to adjust their phone background CPU activity alert threshold just so that some developers can use a different push notification framework?
- return1 6y agoWe just need an SMTP extension that says ‘this email is a notification. Delete after x days’. The rest of the mechanism is there. Apple and google will follow. Emails may not be instant but most notifs are not urgent. I know there are 1000 other protocols out there, but email is the only one that s widely used and hasn’t been bastardized or wallgardened
- crizzlenizzle 6y agoThings like this explain some devs I encounter solve networking things which could be done on a LAN level using multicast for instance instead through the cloud.
- marcan_42 6y agoMy biggest problem with FCM is how hostile it is to open source and self-hosted services. If you want to push a message to a phone, you don't just need to be registered with Google; you need to be the app developer. App developers cannot allow third parties to push to their app, because they'd have to give them their FCM credentials, which is a no-no. So the only way to get push notifications on, say, apps that provide a client for generic protocols or self-hosted services, is for either the app developer to run a proxy gateway (which inevitably runs into scalability issues forcing them to start charging for it or require registration with free quotas), or for you to create your own build of the app. I ended up having to do that with Linphone, rebuild it under my own app ID with my own FCM creds, just so I could get push notification integration with my own SIP server instead of having to keep a background SIP connection open to receive calls. This is completely silly, with the only free endgame being everyone has to compile their own apps and have one app installed for every potential provider, even if they share a protocol.
- techslave 6y ago> they'd have to give them their FCM credentials, which is a no-no. trivially addressed via a proxy, which you’d want anyway to properly monetize it
- jlokier 6y agoGP: "open source and self-hosted services" There's probably no wish to monetize, just to distribute working apps for free. You're right that the issue is easily addressed with a proxy. But now you need to maintain and pay for a proxy in perpetuity, for other people to use who aren't paying anything. Even if it's cheap, maybe you don't have the time. It will break occasionally. Knowing there are people who may depend on it 24x7x365 is burdensome too. You'd like to have vacations. It's not very open source friendly if other people can't just take your software and run it themselves without depending on you. Those other people can avoid depending on you by registering themselves with FCM, but having to do that is not open source or self-hosted friendly either, which was the GP's point.
- whatsmyusername 6y agoAny end-user tech that requires a listening port on the internet will: A: Never work, because NAT isn't going away (even with increased IPV6 adoption). Even locally it will work less and less because "block all incoming connections" host firewall configs will eventually become the norm. B: Be a security risk waiting to happen (EX: Chromecasts using UPNP to expose themselves to the internet, which were immediately blasted with broadcasts from one of PewDiePie's wretched fans).
- guerby 6y agoI've never looked deeply into this notification thing but people seem to conflate saving the battery and having only one notification server. If energy used by firing up the CPU frequency plus the 4G radio to send some packet is the main battery drainer, why not just synchronize the poll of multiple notification servers? The CPU will be waked up, a few data packets will go to a few notification servers, then in the common case of no notification everything goes back to sleep. If it's the network that wakes up the phone when some packets are there (as WiFi energy saving does), if synchronized in time (NTP goog enough) it should also work and be energy efficient. Probably naive, curious about real world measurements in this area :)
- kylecordes 6y agoTechnically there is a workable solution somewhere close to what you describe, and it should cost tiny extra power usage vs the fully centralized design. But imagine you are a company running one of the big mobile platforms. You could invest effort in the APIs and OS behavior to do this, and the payoff would be loosening your grip on the ecosystem. Tough to justify to those watching the ROI.
- room500 6y agoJust one issue - there are timers on connections regulating how long a connection can be kept alive before a packet is required. Larger timeouts are better for phones, but require more resources on the servers/networks. Google/Apple work directly with carriers to extend the timeouts for their push services so the phones aren't required to send keepalive packets every 30 seconds to keep the connection alive. Carriers won't be willing to do that for every random server out there. This is just one of many ways these push services are carefully designed/operated to save as much battery life as possible. If you had more than one notification service, battery life would degrade to the worst performing one (the radio would be forced to wake up to keep every notification service alive... Even if the Google one could go minutes between the keepalive packets) (Another is the way Google batches low priority notifications... Sending a push message won't immediately wake up a phone - it delays to try to batch as many messages as possible. This scheme breaks down if messages aren't all routed through a single server)
- maple3142 6y agoGCM doesn't work in China, so the Android ecosystem there is very different from the world. Before manufacturers come up with there GCM alternative, each apps actually have there own service to handle push messaging. It is fine when the number of apps is small, but drains a lot of battery when it gets larger. So manufacturers started to introduce some aggressive strategy to kill background processes to save batteries, but it also makes small developers' app less usefull. It is because apps from big corporations usually get a pass, while others will be killed. Now, as far as I know, manufacturers have their own GCM alternative now as an alliance. So I think even if you don't have it, you eventually need one, because it is too inefficient to let each apps handle this by themselves.
- anthropodie 6y agoWhy not start using OpenPush which is decentralized https://news.ycombinator.com/item?id=22306174 https://news.ycombinator.com/item?id=22306174
- snthd 6y agoRelated (Android): https://dontkillmyapp.com https://dontkillmyapp.com
- draw_down 6y agoFunny to see “saving battery” in scare quotes. People actually do care about that! And they care about that a hell of a lot more than getting push notifications from the LAN.
- jayd16 6y agoThis article is just lame. OP couldn't seem to figure it out but you can implement a background service. >why not shutdown location and frequent play service updates as they aren't helping my phone battery either They do. The recommendation is to use the location library that batches GPS use instead of manually calling it per app. The playstore uses heuristics to know when to query for updates and when to download. Its better that the OS batches these sorts of things. There may be some valid critique but this article is devoid of anything useful.
- gravypod 6y agoFor anyone who's worked on an IoT platform built in Android this is a huge pain that's nearly constant.
- SergeAx 6y agoIf I have 50 apps on my device and 30 of them are keeping connection to their mothership-server — they will indeed drain my battery in hours. I can't imagine a plausible solution for that problem except centralized notification service.
- deleted 6y ago[deleted]
- 67868018 6y agoApple has this solved for iOS 14 https://developer.apple.com/videos/play/wwdc2020/10113/ https://developer.apple.com/videos/play/wwdc2020/10113/