Closed insytes closed 2 weeks ago
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign the CLA at https://www.nativescript.org/cla.
CLA has not been signed by users: @insytes.
After signing the CLA, you can ask me to recheck this PR by posting @cla-bot check
as a comment to the PR.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign the CLA at https://www.nativescript.org/cla.
CLA has not been signed by users: @insytes.
After signing the CLA, you can ask me to recheck this PR by posting @cla-bot check
as a comment to the PR.
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
Excellent work @insytes 😍
Adding the description notes into the README to document the new ability would be good. It can also make note of the iOS minimum on seconds, we can then publish this with a minor bump.
@NathanWalker README updated, I added the iOS note to the ScheduleOptions table.
Released with 6.2.0
Closes #73
What's new?
Allows notifications to be repeated with more precise intervals.
ScheduleOptions.interval
can now be defined as either aScheduleInterval
or an object describing an interval{ [ScheduleInterval]: number }
Example:
interval: 'day'
*Existing functionalityinterval: { 'second' 90 } // on iOS a minimum of 60 seconds is still required.
interval: { 'minute': 15 }
interval: { 'hour: 6 }
A new boolean option is added
ScheduleOptions.displayImmediately
This can only be used when an
interval
is provided. It cannot be used when a trigger is defined as an exact date usingat
.When
ScheduleOptions.displayImmediately
is true, a separate notification will be scheduled that will be displayed ASAP.Known limitations
The limitations on the new iOS Notification API (iOS 10+) means that notifications cannot be scheduled at an exact repeating interval after a precise date is defined.
In other words, we cannot define a notification like this:
The only option when using
at
is the existing behaviour of the plugin, a calendar unit.Using the new stuff
With the newly available options we can schedule a notification to repeat on a calendar unit, multiplied by a given amount.
For example:
Using the existing options as before:
Proceed?
Some more eyes on manual testing would be great.
Given the limitations on iOS I feel this change provides the best quick wins for slightly more control over repeating intervals.
Any thoughts?