[PAID] ⏰ Alarm Manager Extension with Notification or Autostart

Please set the alarm time always to a time in the future... to get a notification immediately use the NotificationStyle extension
.
Taifun

Thanks for your advice. But as I mentioned, using call alarmmanager.Start method with interval=ONCE, alarm was not fired even if I specified a future time. Tested using the sample alarmmanager app.

Show us a screenshot of the example app like this


Important: and close the app after setting the alarm, else the AfterAlarm event will be triggered and you do NOT get a notification

Taifun

I have the same problem, here are my screenshots (sorry for the spanish, but if i change it to english i have to do this all over again)

See here: How to ask a question (open new topic)

Please learn how to work with the clock to set a date and time in the future

You are setting only a time, which results in the first January of 1970 together with your time...


Screenshot_20230925_052435_DuckDuckGo

Taifun

On porpuse i didn't set the date, i want it to work first on the time and it worked it show the startText "Hi" but not the notification, that is my original problem, but okay i set the date and it shows this


you have to correctly set date AND time in one instant
now you only set the date and therefore you get midnight of that day

for example this sets an alarm to now + 1 minute

Unbenannt2

and this sets an alarm to a date and time provided from a label and time picker

Taifun


I have been unable to get the alarm manager to work. I get the error that it needs permission. It appears the permission is set after turning it on, but the error keeps going.

The precompiled APK from the download folder installs and works fine. However, nothing I compile works.

Running android 14

I tried asking for permission


However, that just does not work.

I can manually go settings > apps > MyApp > Alarms &Notifications > Alow Switch. Then it works. Is there another name for this permission or a way to ask for this permission?

Taifun, for Android 13+ you need to include USE_EXACT_ALARM permission.

Are you using the latest version 7a of the extension?
Taifun

Yes I am using version 7 now. The same error message pops up and going into settings manually to set permission is still required.

Where is this version (and the changes made there) explained in the extension documentation?

Ok thank you
I just got my Samsung A54 updated to Android 14 and can confirm the issue on Android 14. I will check what needs to be done. The extension btw. already uses SCHEDULE_EXACT_ALARM.

This is the version as of Sept 26th, 2023

Extension rebuilt to avoid "ERROR: DX returned an error code" for projects, having 2 extensions or more which use proguard to obfuscate their code, see also Pull request 3004.

EDIT: There is a new behavioral change for Android 14, see also

Taifun

1 Like

Version 7b has just been released

now the extension does not use SetExact anymore, because according to the Google recommendations Applications are strongly discouraged from using exact alarms unnecessarily as they reduce the OS's ability to minimize battery use.

Please find the updated version 7b in the download folder

Taifun
PS: @Tammi_Allen thank you for your report

1 Like

This extension only works on some phone models. When I bought this extension in 2021 it worked well. but since 2022 it has stopped showing messages. wasted money. (the test apk file that Taifun sends also does not work on Samsung A10 Android 11)

Google updates the Android system from year to year and so also extensions need to be updated to still work. I not only keep the extension up to date to follow the new restrictions from Google, I also provide the updates for free.

The only thing you have to do is to update to the latest version of the extension and adjust your code to follow the latest Google rules. It looks like you failed to do this.

If your app stopped showing messages, you now have to request post notifications permission. Read the documentation and check the updated example project about how to do it.

Please be more specific to get help. Which device manufacturer do you have problems with? Probably Xiaomi? See also Q3 here App Inventor Extensions: Alarm Manager | Pura Vida Apps

Taifun

Thankyou for the update Taifun. It appears to work now for notices and autostarts.

A couple of quick questions..

  1. Can the program be autostarted without opening the screen on top?
  2. Are the alarms lost when the phone reboots?

what is your use case? This might be possible in combination with the itoo extension... you might want to say more about what you need and I can think about how to get it running...

no
from the documentation at App Inventor Extensions: Alarm Manager | Pura Vida Apps

The defined alarms will be reinitialized after rebooting the device.

Taifun

I wrote to you on which phone it doesn’t work at all or are you deliberately ignoring it. I used your apk file that you sent me by email (the updated file is the latest), it does not work.