简体   繁体   中英

Android push notifications when app is killed

I have the task of finding out how to prevent newer android devices from killing the app which then will no longer be able to send local push notifications.. is there a way to do it ? I've heard of GMS.. any good ?

Scenario: User has a meeting in 21 days and one day before it he wants to get a notification. This should be stored locally, no server thing I guess. ?

Thanks

Update: Best Link: https://en.proft.me/2017/05/7/scheduling-operations-alarmmanager-android/

For push notifications you should use FCM (Firebase Cloud Messaging), GCM is deprecated and passed away.

FCM allows you to handle a messages, even if app is killed.

There are two types of messages in FCM, notification and data messages. Data messages are always processed by your app, notification can be handled automatically, if app is killed.

But you should use WorkManager or JobScheduler or something similar to schedule your job, because FirebaseMessagingService will be killed soon after receiving message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM