I need help, I installed the extension and tried to create a task application with notifications, I tried to guide me from examples and looking at the web page, the tasks are saved in the database but are not activated at the time
Having some trouble getting this notification to post.
I have the background procedure starting here.
and then i have it supposedly going off every 10 seconds. (which i can't confirm yet because i can't get the notification to load, and im a noob at figuring out log stuff), which is supposed to give off a push notification with this.
i am asking for all the permissions outright, just because i wasn't sure if that was the issue causing it.
And then starting the background process, Which is posting the normal "running in background" notification.
Am i doing something wrong here?
Either my background process isn't going off correctly, or I've messed something up with the notification block/permissions.
hopefully you can point out my mistake for me
just let me know if i should supply any further details or ss of other blocks
Can you describe more in detail what you are trying to do?
The purpose of the alarmmanager extension is to trigger an alarm in the future and for example to display a notification or autostart your app
As it looks like you are trying to trigger a notification immediately... for this you should use the Melon Notification extension instead of the alarmmanager extension
this app is to serve push notifications for a game that i play.
its a web browser based game, and doesn't offer push notifications natively.
So the goal of this app is to read the persons api response, and create notifications based on it.
The only thing provided by the api though is a timestamp of when the thing was started. i have to do the math to figure out when it will end.
i want this happening in the background on its own. So that the person always recieves the notifications. And additionally, the app simply references the itoo information that i save when processing the data. That way the data is always up to date, and is updating on a regular interval (which will be 5 minutes once i confirm that the background process is actually happening, and then set to a custom number by the user later after that.)
Then i just plug the timestamp into the alarm manager as an instant, and bang. push notification.
thats kind of the basic over view, let me know if you need more detail.
For short time intervalls (below 15 minutes) my suggestion is to use itoo together with a clock and the melon notification extension
If you like to continue using the alarmmanager extension and start an alarm via itoo as you are trying to doi it from your latest screenshot, you will have to fix your blocks like this:
In your procedure background _procedure there are 3 things missing: 1) the argument x
For the main background procedure, you need to include an argument "x".
a statement
evaluate but ignore result TaifunAlarmManager1
A component does not get created until you touch any of its block
and 3) as you are using the web component to get some data from the api, you also should register a Web1 GotText event and create a corresponding event handler for rhat
Also in your test project don't use a clock to start the same alarm every 10 seconds again amd again, start it only once and be patient until the notification gets diplayed
For your test project you only have to ask for post notification permission and optionally schedule exact alarm permission
Fir debugging add Notifier LogInfo methods into your blocks and use logcat to check
most of what you explained here i have already. with the exception of the "x" value. which i have now added.
However. My issue is that i cannot get the alarm manager to post a notification at all.
after your suggestion about the "now" instant, i've added 30 seconds to it in the hopes that it would come through. But no luck so far.
To clarify. I have used the melon notifications, but it wasn't working from the background, which i suspect was because i was missing that "x" argument.
would still love if you would explain where i'm going wrong with the notifications from the alarm manager though.
I've put it into a manual button for the moment for testing. But i'm not getting the notification.
And i have looked through your examples several times... im sorry to say i am just failing to notice where my mistake is. if you need more blocks let me know
What about trying my simple test project from the download folder?
From your screenshot it looks like you forgot to ask for post notification permission. Also use event Started to see, if the alarm has been set correctly... Btw. an index in App Inventor starts with 1, so I would use id = 1 instead of 0...
Then close the app and wait for the notification
EDIT: use the close application method for that. Remember, if you do not close the app and the app is still running at alarm time, then event AfterAlarm gets triggered...
Default is inexact alarms, so be a bit patient until you get the notification or ask additionally for schedule exact alarm permission
Note : Google recommends to use exact alarms wisely to reduce battery consumption. See also Use cases that might not require exact alarms. If you decide to use exact alarms, then the user needs to grant the SCHEDULE_EXACT_ALARM permission, see method AskForScheduleExactAlarmPermission
Btw. which device and Android version are you using for your tests?
Taifun
I'll try to address each part in the same order your presented it.
at the time of this post i haven't tried the test project yet. But I'll add that to my list today when i get a chance to sit.
I am asking for all the permissions, because i was unsure at the time if one of the other permissions was needed for the notification to post.
And the itoo process is starting (the notification is posting in the top bar). You addressed it earlier, and i think i fixed the process by adding the "x argument". But again havn't sat down to test it. Was a busy day yesterday.
I've fixed the index you mentioned, and will note that for later. My brain always says 0 for lists xD
And I'm using the "exact alarms" i think, unless there is an additional step after asking for the permission?
My current device for testing is my personal device, as this is the device i had planned to mainly use the app on.
is the "open above lockscreen feature" limited only to alarms(can only be triggered by alarms), or can that be triggered by a stimulant, say when bytes/strings are received by a BLE module?
i believe that feature also brings the app to the foreground if im not wrong?
im trying to trigger an alarm using itoo and ble and it works, but not in a way i expect it to work. instead of anything appearing on the lockscreen, i get only a notification with the title and text. i created another screen for lockscreen but it doesnt appear. i tried to follow the lockscreen app as much as i could, and the lockscreen app works perfectly fine, but this doesnt. i dont understand where the issue is. (even if the alarm activates because of ble received, the alarm still should perform as expected right?) all permissions required have been enabled as well.
is it because itoo is interfering with the app with the createprocess block?
ALSO: in recent xiaomi mobile phones, theres an additional show in lockscreen option that needs to be enabled by opening app settings. (advice)