cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

How to Set Trigger to Repeat Every 5 Minutes

Open GitFr33 opened this issue 4 years ago • 3 comments

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.

GitFr33 avatar Jul 29 '20 17:07 GitFr33

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.

GitFr33 avatar Jul 31 '20 03:07 GitFr33

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.

hnguyen48206 avatar Nov 09 '20 09:11 hnguyen48206

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.)

GitFr33 avatar Nov 11 '20 04:11 GitFr33