This happens, because you are not using the latest version... just import the latest version of the extension and build again...
Jan 6th, 2024: Version 7b: "set exact" alarm replaced by "set" alarm because of Android 14 behavioral changes. The extension now does not use SetExact anymore, because Applications are strongly discouraged from using exact alarms unnecessarily as they reduce the OS's ability to minimize battery use.
It looks like you found out meanwhile, that you first have to ask for Appear On Top permission, see also the autostart example project, the documentation at App Inventor Extensions: Alarm Manager | Pura Vida Apps and my answer from some days ago here
Thank you @Kumaraswamy for this amazing framework!
Itoo is a powerful framework to execute blocks in the background. Version 8 of the alarmmanager extension uses the new itoox-wrapper library and provides the new OnReceive event handler (which looks like a procedure). By default the event handler is located in Screen1. But you can set the property ReferenceScreen to use the event handler on a different screen.
The background event handler will be called from Itoo from the background after an alarm occurred. You will have to create the procedure using the name OnReceive. Also that procedure must have 3 arguments, else it will not work. Note: This background event handler also will be called if the app is in the foreground.
Now we can execute almost any logic in the background (no user interface components) after an alarm occurred and even define new alarms in the background. Please be aware, that there is no user interface available in the background.
Preconditions for using the OnReceive event handler together with Itoo
You should already have some experience in App Inventor and understand the basics. If you are new, then first learn App Inventor and come back later for these advances features. Alternatively you can contact me by email to get personal support for a small fee. As beginner you already can use the alarmmanager extension without the OnReceive event handler!
You are familiar with the Do it debugging functionality of App Inventor.
You are familiar with using Logcat. To find possible errors of your blocks in the background, let me suggest to filter the logcat output for the tags TaifunAlarmManager, Notifier, ItooCreator and System.err.
Guidelines for using Itoo
First get your background functionality running in the foreground. Like this, you can find errors much easier. And as soon as you got it working in the foreground, then test it in the background.
Do not use global variables while in the background, use local variables instead
Do not use any user-visible or UI components in the background
In the background, use the Itoo StoreProperty/FetchProperty methods rather than TinyDB. TinyDB relies on SharedPreferences which will not ensure data synchronization across background processes.
Example use cases
Run a function when the alarm is activated and also set the next alarm without opening the screen or disrupting the user experience (requested by Tammi_Allen)
Send a text message after an alarm occurred
Do something regularly in the background or after booting the device.
Is the alarm test app updated on the play store?
I downloaded the app, started the alarm, but only the notification is received in the foreground. In the background it is not received (nothing happens)
Xiaomi Android 11
Let's asume, as test you set an alarm in ten minutes, then you reboot the device. After rebooting and unlocking your device it takes a little bit of time until your device restarts all necessary services including the boot service of your app, in this case of the alarmmanager example app, which will set again all defined alarms.. After that your alarm will occur at the previously defined time.
If your alarm time meanwhile is in the past, then the notification will be displayed as soon as possible after reboot.
This feature is already available since version 2 of the app, i.e since November 2020. . meanwhile we are at version 8...
Now as soon as I set the alarm again after a half hour, I immediately rebooted and saw that the alarm I started had disappeared again.
I'll try one more time without rebooting
If you have questions, then please ask them in a way, others are able to understand them...
??
The notification will be displayed using your default notification sound
Make sure, the sound is not muted
Unclear what you are trying to tell us
Please explain in detail and make sure to not confuse yourself
Also after rebooting give your device a bit of time to start all services
If you define several alarms make sure to use another id for each alarm, else an existing alarm with the same id will be overwritten
You always can check, which alarms have been defined using the GetAllAlarns method
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.
after diabling battery optimization then test again
set an alarm
check the GetAllAlarms result
Reboot the device
unlock the device and give the device some time to restart all services
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.
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..