Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

any app can raise a Notification i.e. a message box thingee that appears in the device's Notification Drawer. (this is different from a Push Notification.)

and I think what the OP was talking about was this kind of Notification. i think he was saying that various apps that count on reliably running code in the background (e.g. when the app itself is in the stopped state and not visible on screen) are no longer able to reliably run that code in the background because Android decided not to let them do that on demand in a reliable way (in order to save battery). but that backgrounded code is what had been placing notifications in the Notification Drawer (when, say, the app became aware that there was a new email in your inbox or when a Calendar appointment was now one hour away, etc).

as for push notifications, nowadays, Firebase Cloud Messaging is recommended. your app derives a service from FirebaseMessagingService and marks that service as "exported" in the manifest. and, you don't have to explicitly start that service. and, though i could be wrong, I think that service does not actually run in the background all the time. i think what happens is that some generic Firebase service invokes your app's service when a push notification has arrived for it. your app's service then processes that message as desired, and, if I understand correctly, it shuts back down. i believe Firebase is basically managing your service so that it does not have to run in the background all the time.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: