Recurring Toasts with Windows 8.1 Store Apps build with JS - windows

I've been trying to create notifications that happen on a weekly basis - for example, every monday at 8am.
I've tried to use a recurring toast for this - http://msdn.microsoft.com/en-us/library/windows/apps/hh465417.aspx - but realized that the recurrence parameters are more designed for a snooze functionality, with a maximum delay of 60 minutes, and a maximum repeat for 3 times.
Is there a suggested workaround for this?
Is there a best practice for such a use case?
Thanks!

You're right that the recurrence on scheduled toasts is designed for snooze. Unfortunately, the API doesn't provide a way to show the same toast multiple times on a fixed schedule.
You'll need to manually create a ScheduledToastNotification each time you want it to be shown. In your example, you might create and schedule out a toast a week for each Monday at 8 AM.

Related

Scheduling a task periodically in an android app using WorkManager(Coroutine Worker)

I'm trying to run a task periodically every 12 hours, I'v used Work Manager and followed their documentation. The task is running periodically well as long as the user is actually using the app.
But if i close the app, or even just let my phone be idle for a while, it seems like the task stops working.
I searched for this problem on google, and came across posts such as this post, which i think explains the behaviour on my phone.
From my understanding, this problem is not related to work manager, but to all frameworks who will try to run background tasks?
Is there a way to still periodically run tasks on most devices or is WorkManager is still the way to go?
Thanks!
Please check this:
https://developer.android.com/topic/libraries/architecture/workmanager/how-to/debugging#use-alb-shell0dumpsys-jobscheduler
Required constraints: TIMING_DELAY CONNECTIVITY [0x90000000]
Satisfied constraints: DEVICE_NOT_DOZING BACKGROUND_NOT_RESTRICTED WITHIN_QUOTA [0x3400000]
Unsatisfied constraints: TIMING_DELAY CONNECTIVITY [0x90000000]
Minimum latency: +1h29m59s687ms
Run time: earliest=+38m29s834ms, latest=none, original latest=none
The periodic work is not exactly Periodic. You have different Constraints:
Explicit - you set them.
Implicit - set by the system related to Battery optimization. You should save the battery and also Internet usage.
When you have a "periodic work" you actually have an explicit constraint called:
TIMING_DELAY. But when the time is passed it does not mean that the work will start. It means that this constraint is satisfied and if and only all the other constraints are Satisfied - then the work will start.
And for example, you have your work with a "period" of 12 hours, but you wait an extra 4 hours for the other Constraints - you will have a period of 16 hours.
And after the work is finished - WorkManager will create a completely new job in the JobScheduler with TIMING_DELAY again - 12 hours. It will not account for the extra 4 hours. So you can't imagine something like:
I have 5 days so it means - 10 executions. It might be only 4 or 5 executions.
You can improve this by asking the user to exempt you from battery optimization:
https://developer.android.com/training/monitoring-device-state/doze-standby#support_for_other_use_cases
If you need to be really exact - you need to use AlarmManager, but mostly the idea of all of this is for the battery to be saved so it is not only about what the devs need, but also what the user needs.

Use gocron scheduler to schedule job on specific day at specific time

I want to schedule a job on a specific day at a specific time with some interval. I am using gocron scheduler for this. But I can't find a way to start a job on specific day. e.g. I want to execute a job on 7 Sept 2019 at 330pm. From 7 Sept, I want that job to be executed daily or weekly. How can I do that using gocron. or Any other packages available?
I tried passing UTC time to gocron.At() but its panics as it's expecting only "03:30" time formats and doesn't expect date.
When looking at the documentation for gocron, it does not seem to be designed to support scheduling things for specific days. It seems to be designed as a way to schedule things to run at various intervals, very similar to what the original cron utility was designed to do. So you would specify "I want this function to get called every 2 hours" or "I want this function to get called every Sunday at 3PM". There does not seem to be any documentation about starting jobs from a specific day.
The mentioned At(string) method is documented as allowing you to specify a time of day to run something. So you would use that to set that your job runs at 3:30PM.
If you wish to specify a start time, you would likely need to find another scheduling library or implement it yourself by creating a goroutine that sleeps until a specific time. The StackOverflow post mentioned by domcyrus looks like an excellent resource for implementing it yourself as well as listing some other scheduling libraries.

Jfxtras Agenda - Better Support for Non-overlapping Appointments

How do I make the Jfxtras Agenda component treat the following two appointments as non-overlapping? Also, is there a way to increase the snap-to-grid granularity of the grid from 5 minutes to 30 minutes, to mimic Outlook? With the 5 minutes precision, it is very difficult to create back-to-back appointments, without making them overlap, or creating gaps between them.
Appointment 1
Start: 2pm
End: 5pm
Appointment 2
Start: 5pm
End: 9PM
I fixed the consecutive appointments rendering issue, the new snapshot should work ok. As for the rounding, I will add a CSS stylable property where this can be set later today.
I simply modified the appointment callback. To make it so that only 15 minute segments could be used to make appointments I used dateTimeRange.getStartLocalDateTime().minusMinutes(dateTimeRange.getStartLocalDateTime().getMinute()%15)
You can use this for the end time as well, and from then on you will only get appointments made with 15 min intervals. Just change the 15 to change the interval. The only potential downfall is that you could frustrate users if they shoot too low when dragging, but that could be solved as well with a simple if statement.

jBPM 6.2.0 send recurring Task reminder after 1 day time interval if the task is not complete

I am new to jBPM. I am working on jBPM version 6.2.0. I want to perform following tasks.
Send reminder email to user / group.
Remind the user again after 1 business day if the task is not yet complete. Continue to send reminder everyday untill the task is done.
Also what happens if jboss / tomcat server restarts after sending one reminder email. Will the later emails still schedule ?
I am able to add Deadlines (Escalation- Notification) But it runs once and sends only 1 email. I need to keep reminding the user on a daily basis (or hourly) to complete the task.
I tried looking in jBPM 6 user guide but it does not have clarity about Boundary timer events and intermediate catch time events. And when i use any of them then it runs once.
Any help is much appreciated.
Here is an example of something that I did recently for sending periodic emails.
This should loop until a user finally completes the task. You might have trouble with the one business day rule since I do not know if the ISO 8601 spec is flexible enough to know about weekends/holidays/business days. You could add that logic into your service task for sending the email.
Be aware that this loop will continue forever until the task is complete. You might want to consider adding some additional timeout. You could add a loop count so after X amount of times the process will be cancelled. Some of my processes have a rule that if the process is not complete in Y days, the process should be cancelled. I accomplished that by have a process variable CancelDate and set a Timer Event definition to Date/Time and the value #{CancelDate}.

Windows Phone 8 scheduled agent update custom interval (more than 30 minutes)

There are couple of apps at the Windows Phone Store which are automatically updating phone lock screen by a custom interval, lets say 1, 2, 4 or more hours.
I did some search over internet to find some articles or best practice to implement custom update interval, which is bigger than 30 minutes but without any result.
Maybe you know some code snippets or reference on articles ?
Thanks in advance!
As you have already found, the periodic agents are invoked once every 30 mins. However, you can simply do nothing until your desired update period has passed then execute your update.
You already have access to your app's isolated storage from within your background agent. You can simply store a counter in some file to track the time that has passed and once it meets your requirement you can execute your update and reset the counter.

Resources