Home > other >  Android: How to always send a notification after a specific time period
Android: How to always send a notification after a specific time period

Time:04-30

I'm working on a old Android native app (java) and i have to do the following: send a notification asking the user to sync the app after 24 hour from the last sync. I can't use push notifications, so I have to make the device check locally the time of the last sync and notify the user if 24 hours have passed, but even if the app is closed. Its like a alarm, but the notification should be a "regular notification", of course.

Is this possible? And what is the best way to do it?

CodePudding user response:

Are you looking for doing this directly from the app ? If not we achieved a similar thing using a spring boot server that connect to the fire base and @schedule annotation.

CodePudding user response:

I have same problem. you can use alarmManager with pendingIntent to push notif and use BroadcastReciver. when Notification push , BroadcastReciver start and you can push notif in BroadcastReciver for next day. its easiest way.

  • Related