cordova-plugin-local-notifications
cordova-plugin-local-notifications copied to clipboard
How to Set Trigger to Repeat Every 5 Minutes
Is there any way to make this plugin repeat every time a user-defined number of minutes has elapsed.
I have not figured out how (or if) it's possible to set the trigger object to accomplish this.
At first I thought that the count
element was all I needed but experimenting showed that this is the number of times to repeat, not the number of units between repeats.
I tried to combine the every
and in
elements in various ways ({ every: { in: 5, unit: 'minute' }, count: -1 }
) but I haven't found a solution.
The solution seems to be { every: 5, unit: 'minute', count: 500};
every
must be of the type int for the trigger to work and count
is required.
May you explain more about the count here, does it mean the total number of notifications that will be fired, in this case 500 messages for 500 minutes, one for every minute? Thank you.
It seems that it means (on Android) the total number of notifications that will be fired. So in this case 500 notifications. One every 5 minutes. (for a total of 2500 Minutes.)