Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy--Plyer--Android--sending notification while app is not running

I am writing a python app in kivy.

The idea is to allow the user to make notes of bookings for certain dates, and then the program should send them a notification on that day about the booking.

There's probably a simple way to do this, I am using plyer.

from plyer import notification
notification.notify(title="Kivy Notification",message="Plyer Up and Running!",app_name="Waentjies",app_icon="icon.png",timeout=10)

This works, I get a notification whenever I call that function, however, I can't find any way to send this notification while the app is not running, I do know that there are some other questions that seem to answer this question, but they don't, their simply to run a app in background, which I don't want to do, all I want is something like Clash of Clans notification when your troops are ready for battle, or Facebook's notification when somebody liked your post.

like image 310
Cid-El Avatar asked Aug 20 '16 08:08

Cid-El


1 Answers

I think you should take a look at the Android AlarmManager. If this is what you need, here is an example for Kivy.

AlarmManager

This class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future. When an alarm goes off, the Intent that had been registered for it is broadcast by the system, automatically starting the target application if it is not already running.

like image 186
WJVDP Avatar answered Sep 23 '22 07:09

WJVDP