[PAID] ⏰ Alarm Manager Extension with Notification or Autostart

I have successfully tested the extension on dozens of devices (and all relevant Android versions). It works without any problems, even after restarting the device. Period.


Device name & Android version?

Sorry for my wrong expression, the time I gave to the application was half an hour

Yes android version

this is a Xiaomi device, isn't it? You have to disable battery optimization, see also Xiaomi | Don’t kill my app! , see also several posts in this thread about this, for example [PAID] ⏰ Alarm Manager Extension with Notification or Autostart - #82 by Kumaraswamy...

after diabling battery optimization then test again

  1. set an alarm
  2. check the GetAllAlarms result
  3. Reboot the device
  4. unlock the device and give the device some time to restart all services
  5. after that open the app and check again the GetAllAlarms result and the previously defined alarm should still be there

if it is not, then find the correct settings for your device, see again Xiaomi | Don’t kill my app! especially for MIUI 14

Autostart permission

On MIUI 14, there is a new permission to start from the background for each app, in Settings > Apps > Your app > App permissions > Background autostart.

Taifun

Unfortunately after the reboot the alarm still doesn't exist on my device

you have to find the correct settings for your device for this to work
Read again Xiaomi | Don’t kill my app!

Note: the settings of your device prevent the boot service of the extension from starting after booting the device. Adjust the settings of your device and after you found out what needs to be changed in your settings, let us know to help others with Xiaomi devices in future. Thank you..

Taifun

1 Like

@Carlo_Rotondo you deleted your question? It looks like you solved your issue yourself...

If you want to set several alarms, you have to choose another id for each alarm, else the previously set alarm will be overwritten

Also if the app is up and running at the alarm time, then event AfterAlarm will be triggered and no notification will be displayed, please also check the documentation.

For further questions don't hesitate to ask here...
Pura Vida!

Taifun

i am from pakistan and dont have paypal account. any other payment option?

Yes, the other option is Bitcoin, see also the large green box on the bottom of this page App Inventor Extensions: Alarm Manager | Pura Vida Apps

https://www.google.com/search?q=pakistan+buy+bitcoin

Taifun

why doesn't the notification work? I used two options, neither fire worked. how to specify the time correctly to work the notification? permissions are all granted. extension version 10. isha is time from api ,"isha":"18:44"

You have to create an instant of date and time, for example for today 2024-10-17 18:44

Protip: debug your blocks

EDIT: Also use the Started event to check, if the alarm has been set correctly and at what time

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

time and date as you said but no notification

Read the documentation. and use the correct syntax

MakeInstant(from)
Returns an instant in time specified by MM/dd/YYYY hh:mm:ss or MM/dd/YYYY or hh:mm.

It helps to be familiar with the clock component

EDIT: you also forgot to

Taifun

I checked on the second phone Samsung 11 Android the notification works. But on Redmi 12 Android 14 your extension does not work at all

We already talked about that in the past... it looks like you forgot about it again

What about reading again starting from here [PAID] ⏰ Alarm Manager Extension with Notification or Autostart - #79 by Emissary95 to refresh your memory?

Some device manufacturers make it a bit more complicated, see again https://dontkillmyapp.com

Usually to disable battery optimization helps
I also created an extension for that App Inventor Extensions: Ignore Battery Optimization | Pura Vida Apps

Also let me recommend again to try the example projects to see how to use the extension before starting your own project

EDIT: and especially for Redmi

App Settings → Battery Optimisations → Do not optimise battery

You may also do this

App Settings → AutoStart → Enable Auto Start

Taken from Background notification after 1 day is disabled? - #10 by Xoma - Extensions - Kodular Community thank you @Kumaraswamy !

Taifun

2 Likes

it was at the beginning of the year, then i made notifications work on Samsung, on Redmi and then they didn't work. now the extension version is 10, so i checked if it works or not. all permissions are granted (notifications, battery optimization with your BatteryOptimization extension, autostart), when you click GetAllAlarms, the data in json format is received, but there is no notification. but on Samsung it works fine

As you can see yourself, you have a device specific problem.

The alarmmanager extension offers a lot of options. My recommendation is to start as simple as possible and use the SimpleNotification project as a start. Please see the documentation. Use the apk file simple apk from the download folder. This example requires only PostNotification permission.

Get that example running on your Redmi first before continuing and try these device specific adjustments manually in the settings

Taifun

it all turned out to be in vain. we can't register 5 signals at different times (for example 12:00, 13:00, 14:00, 15:00, 16:00) if the current time on the clock is later than the specified one. this makes the extension useless for me unfortunately..

we can use this block, but I can't divide the time because I get the whole time from the api (fajr":"04:59","zuhr":"12:30","magrib":"17:13","isha":"18:43","), for example 12:00, and for the elshl block the hours and minutes are separate

Well, obviously it only makes sense to set alarms in the future... you could have some logic to do that...

Generally your method of working is very erratically... what about working step by step in a structured way? Don't confuse yourself. And keep it simple.

For your prayer app every day the prayer times are changing. What about writing a procedure, which gives you only the next prayer time? Then set the alarm to that time. And after an alarm gets triggered, get the next prayer time, etc. This process will work as long as there is internet access available.

Taifun

1 Like

what is the answer result of this block? true? does it trigger when a notification appears?
started