[PAID] ⏰ Alarm Manager Extension with Notification or Autostart

Thank you for your reply!
I've tried this, but sadly it still did not work :sob:

Really Thanks a lot for your help!

I downloaded the app and tried a few time, but it still send the notification only when the app is fully closed.

My device type is HTC One A9s, and my android version is 6.

The question was:

Try this:

Put the app in the background by clicking on the device Home button and wait ...
The app will be opened at the picked alarm time:

grafik

2 Likes

Thanks a lot, it finally worked!

I did not receive the notification when pressing "home" button on the device (which would make the app to the background), but it worked when I pressed "close" button in the app (which would also make the app to the background).

I tried the "close" button before, but it did not work. It works with your app!
But if anyone knows how to make the notification work without pressing the close button or close the app, please also tell me, thanks!

Thank you again for your great help!

Why are my notifications not working? help solve the problem

Read the extension's documentation. In particular, what is Id.

2 Likes

thank you @Patryk_F
exactly... for each alarm you have to use your own id, if you use the same id, then you will overwrite the previously set alarm...

Use your own id (integer value). If you use the same id again, then the previously defined alarm, which already uses that id will be overwritten..

also as I suggested already in a PM, what about using the Started event to find out, if setting the alarm was successful...it also returns, which id, interval and datetime was used

Taifun

1 Like

also if you use the interval ONCE, then notifications obviously will be triggered only once... depending on what you need, there are several intervals to choose from...

For the Start method
Interval can be one of the following values: 'ONCE', 'WEEK', 'MONTH', 'YEAR'.

For the StartRepeating method
Interval can be one of the following values: 'FIFTEEN_MINUTES', 'HALF_HOUR', 'HOUR', 'HALF_DAY', 'DAY'

protip: read the documentation

Taifun

1 Like

ID i write a different one for each notification. but the extension doesn't work. what's wrong with the code?


You are trying to set 3 alarms... to be able to do that, you have to do it asynchronously... i.e. set the first alarm, in the AfterAlarm event after the first alarm has been set successfully set the second alarm, in the AfterAlarm event after the second alarm has been set successfully set the third alarm...

Please be patient to get an answer... today is Sunday and I'm traveling....

Also generally if you think, the extension is not working, the first thing to do would be to use the example project to find out, how to use the extension before claiming, that it does not work...

Thank you
Taifun

3 Likes

New in version 5: Autostart property added.
You now can choose if you want the extension to show a notification or autostart the app at the given time.

New blocks
new2
new1

To use the autostart feature, the user needs to grant "Appear On Top" permission. See the new methods HasAppearOnTopPermission and OpenAppearOnTopSettings . So while the user is using another app, at the given time your app will get priority and will appear on top of the other currently running app.

This is what Google is saying: Android 10 (API level 29) and higher place restrictions on when apps can start activities when the app is running in the background. These restrictions help minimize interruptions for the user and keep the user more in control of what's shown on their screen. In nearly all cases, apps that are in the background should display time-sensitive notifications to provide urgent information to the user instead of directly starting an activity.

For security reasons it is not possible to bring the app to the front in case the screen is locked. You first will have to unlock the screen.

For details, see my webpage here https://puravidaapps.com/alarmmanager.php

Theoretically this extension now also works in Kodular, however unfortunately they introduced a new bug, see also this Kodular error report...

Taifun

2 Likes

@taifun la sto provando su un Galaxy a 40 e funziona!

[translated]
I'm testing it on a Galaxy a 40 and it works!

1 Like

Hello Anke.

Can you tell me how to make it send a alarm notification when the app is fully closed.
Its possible to make it open and show a notification to ?

I think I did know if my app is working on a background, how can I see this ?

thanks.

For this extension you have to set the alarm while the app is up and running

You have 2 choices.

  1. start tha app at a given time without notification
  2. display a notification at the given time and after clicking the notification open the app

Taifun

2 Likes

@Vitor_Quelhas ti consiglio l'estensione di @Taifun; difatti la utilizzo e posso confermarti che fa esegue le notifiche in background in maniera ottimale.

1 Like

Thanks very much for the answer, but what I really need its to make it work when the application is closed, like in the second plain.

yes, the extension will send the notification while your app is closed... you might want to read again, what the extension is able to do (protip: see the documentation here App Inventor Extensions: Alarm Manager | Pura Vida Apps)

Alarm Manager Extension to send a notification or autostart the app at a given time only once or repeated by an interval. In case autostart=false then after clicking the notification your app will be started. You can define a start text, which will be passed to your app in method 'get plain start text' and trigger some action after your app is started. Also of course works if your app is not running. The defined alarms will be reinitialized after rebooting the device. You also can define several alarms, just use a different id for each alarm.

everything else is out of scope for this extension

Taifun

Version 6 is now available.

new in Version 6: new method startAtBoot to start an alarm at boot time (i.e. display a notification or autostart the app)

startAtBoot

For details, see my webpage here App Inventor Extensions: Alarm Manager | Pura Vida Apps
Taifun

Hello Taifun, yesterday I bought your extension and it works perfectly, I had even read in this forum of some people that the notification was not shown when the app was minimized, and well, it works for me with the application closed and in the background, I wanted to ask you Something, do you think it is possible for you to make a slight explanation about the .canceled function? For example, how does it behave when the app is closed and when the app is in the background? And some practical case examples. Thank you very much I hope you are very well like your family.

1 Like