iOS Question [B4XPages] B4i Alarm

RauchG

Active Member
Licensed User
Hello everyone,

I'm working on a CountDown app. With a CountDown, the date and time are counted down using a "timer1_tick". If the date and time are less than / equal to <= than now, an alarm is to be triggered. The app is in the background and should be woken up or a notification should pop up.

Here is an example that "LocalNotifications" works. It works if you click on the "btnNotification" button. The app can be in the background and the notification pops up.


Is it possible to trigger the event not by clicking on the button, but by a "timer1_tick" event?

In my app, a toast "hd.ToastMessageShow (lblcdName.Text &" has expired ", False)" works via the "timer1_tick".


Greetings RauchG
 

Attachments

  • CountDown.png
    CountDown.png
    90.5 KB · Views: 50

RauchG

Active Member
Licensed User
Why not calculate the expected time and schedule the notification to show at that time?

I have now taken a different route. In the CustomListView I show an alarm button. This activates

ln.Initialize (DateTime.Now + (mLongFromNow) * DateTime.TicksPerSecond)

mLongFromNow = the calculated seconds

The notification works. But only with a countdown. If I want to call two CountDowns, only the last one becomes active. It is also clear because the last calculated time is transferred. The first ContDown is ignored.

I am now trying to write the different calculated seconds in a table and to transfer the smallest value, when the notification became active, delete and transfer the next value.

Could that work?
 

Attachments

  • IMG_0011.PNG
    IMG_0011.PNG
    278.5 KB · Views: 43
Upvote 0
Top