How can one display a system notification in android when the app is destroyed like most social messaging apps.
Asked
Active
Viewed 211 times
0
-
you can do this by using services in android, keep them running in background – Farrokh Oct 07 '18 at 11:54
-
Please @Farrokh can you point me to a sample that uses services to prompt the notification?. – Besong-Anong Ernest Oct 08 '18 at 22:50
1 Answers
0
The best way to do this, is to use Firebase Cloud Messaging for your purpose. https://firebase.google.com/docs/cloud-messaging/
Of course you can use Services to show Notifications from your app, but then you need to take care of your Services to keep your Services alive to update your messages and send notifications.

Viktor Vasyliev
- 164
- 5