flutter_local_notifications
flutter_local_notifications copied to clipboard
Custom intervals for periodicallyShow
Are there any thoughts on adding custom intervals for showing repeating notifications?
Currently it supports the repeat intervals (EveryMinute, Hourly, Daily, Weekly).
But for my case I would be interested in having the users select the interval themselves.
Without going to much into the businesslogic. Basically the user sets a reminder and chooses a time interval e.g. every 5min, 20min, 1.5hours, etc. It would most likely always be in the range of 5min - 4hours.
Have been thinking about it. The reason why it's not there was that there are devs that are also targeting iOS 8 and 9 and custom intervals like that aren't supported. However, the fraction of devices on those versions are very small so that's why I'm considering this ATM. This will mean it will be a function (possibly an overload) that only works for Android and iOS 10+ so will need to be clearly documented
+1 ...I would need this as well! Hoping to set intervals in terms of every week, every other week, every three weeks, every four weeks...
I have seen your fork and I'm always open to look at a PR :)
I did, I just tried changing the static values for minute, hour, week, etc but I am not quite sure if this will work or repeat properly until testing, but iOS notifications seem to work. Also having trouble with android getting notifications to show reliably atm...currently a work in progress
Is it possible to combine every other week with specific weekday (e.g.: Monday and Friday)?
Any updates?
@cesarureno I'm actually looking to close this now as no one has looked into contributing a PR despite how long this issue has been around. I would say if you're after this feature that you look into implementing yourself and submit a PR if possible
Oh, I see @MaikuB I will start to try make some awesome, thanks for your time and your package
Maybe you can do this by combining this package with flutter_background_fetch.
- Just use schedule() to schedule the first notification and store the required interval and starttime in sqlite or shared prefs.
- Create a headless task with flutter_background_fetch that runs in the background every 15 minutes.
- Make the task check if the notification has been sent.
- If it has not been sent schedule a new one based on the starttime + interval of the last notification.
Unfortunately the interval has to be > 15min and checking every 15 min will cost some battery.
I want to be able to schedule a notification for e.g. each 3rd Thursday 18:00 - this is currently not possible.
I can set that target date once with schedule
but I want it to happen periodically.
There is no callback when the notification is actually shown, right? With that, I could schedule the next occurrence.
I'm also looking into 15-30 mins notification interval! I hope this change gets in
@MaikuB It's been over 2 years and IOS 8/9 are less relevant. Maybe this should be reconsidered?
@britannio if you had followed the discussions above then you should see that I said for others to submit a PR for this. Sounds like you need this perhaps you could look into doing so
Hey! Maybe it would be cool to just take a Duration Object instead of the DateTimeComponent.
Or maybe it is possible to use a notificationShownCallback to schedule the next one.
I have read that this should be taken over by the community, but I still have a suggestion, It may be easier to implement when sticking to the current structure and just expand it a little.
- Add the possibility of a specification. I mean something like:
daily.at (12.30,000)
weekly.at (Monday, Friday)
- For a wider spectrum, maybe add monthly and yearly.
I'm also interested in custom scheduled intervals, so that I have one unique ID for one notification and it is pushed e.g. every 3 hours. Specifying a start and end time would also be cool, so that you can program medication reminder apps, for example. I'm still pretty new to Flutter and don't know every source of information. If there are other ways to do this, I would appreciate any tips.
Maybe you can do this by combining this package with flutter_background_fetch.
- Just use schedule() to schedule the first notification and store the required interval and starttime in sqlite or shared prefs.
- Create a headless task with flutter_background_fetch that runs in the background every 15 minutes.
- Make the task check if the notification has been sent.
- If it has not been sent schedule a new one based on the starttime + interval of the last notification.
Unfortunately the interval has to be > 15min and checking every 15 min will cost some battery.
Hello @MaikuB . Please how does one make the task check if the notification has been sent
Hi, I also wanted to show a notification on a specific date every year but currently I don't think it is possible. Is there any workaround for such situations ?
Can we use Timer
in the background and when timer finishes we shall schedule an instant notification ? Will this work ?
Or even we could reschedule the notification once the notification is received but there is no callback for this event
Is it possible to schedule a repeatable daily or weekly notification which will start running at a specific date and time. I was not able to implement it after a lot hours of trying out. If I schedule it to execute on every Monday starting from a specific date and time, then the scheduled date is ignored and next time a notification will appears is the next Monday. Any ideas or suggestions are welcome.
Is it possible to schedule a repeatable daily or weekly notification which will start running at a specific date and time. I was not able to implement it after a lot hours of trying out. If I schedule it to execute on every Monday starting from a specific date and time, then the scheduled date is ignored and next time a notification will appears is the next Monday. Any ideas or suggestions are welcome.
Se https://github.com/MaikuB/flutter_local_notifications/issues/1118
Hi, I also wanted to show a notification on a specific date every year but currently I don't think it is possible. Is there any workaround for such situations ? Can we use
Timer
in the background and when timer finishes we shall schedule an instant notification ? Will this work ?Or even we could reschedule the notification once the notification is received but there is no callback for this event
Is something like _scheduleWeeklyMondayTenAMNotification
in the example not enough?
Hi, I also wanted to show a notification on a specific date every year but currently I don't think it is possible. Is there any workaround for such situations ? Can we use
Timer
in the background and when timer finishes we shall schedule an instant notification ? Will this work ? Or even we could reschedule the notification once the notification is received but there is no callback for this eventIs something like
_scheduleWeeklyMondayTenAMNotification
in the example not enough?
@mvolpato I don't want to schedule the notification weekly. I am creating a birthday reminder app so, I want to schedule the notification at a particular date and time every year.
Hi, I also wanted to show a notification on a specific date every year but currently I don't think it is possible. Is there any workaround for such situations ? Can we use
Timer
in the background and when timer finishes we shall schedule an instant notification ? Will this work ? Or even we could reschedule the notification once the notification is received but there is no callback for this eventIs something like
_scheduleWeeklyMondayTenAMNotification
in the example not enough?@mvolpato I don't want to schedule the notification weekly. I am creating a birthday reminder app so, I want to schedule the notification at a particular date and time every year.
I see. That is because DateTimeComponents
does not have the a monthAndDay
option, right? Then it does not look like it is possible.
Can we use
Timer
in the background and when timer finishes we shall schedule an instant notification ? Will this work ? Or even we could reschedule the notification once the notification is received but there is no callback for this event
I see. That is because
DateTimeComponents
does not have the amonthAndDay
option, right? Then it does not look like it is possible.
@mvolpato because of that very reason i also mentioned 2 other solutions and asked that if they would somehow work
https://github.com/MaikuB/flutter_local_notifications/blob/b7fa709a61207e9cd86b8d5be911c3b49b655776/flutter_local_notifications/lib/src/platform_flutter_local_notifications.dart#L333 We can allow users to pass calledAt so that notification can be scheduled later with repeat. With this, we can achieve custom time for peridicallyShow What do you think? This can save a lot of time doing background fetch and other logic to schedule
https://github.com/MaikuB/flutter_local_notifications/blob/b7fa709a61207e9cd86b8d5be911c3b49b655776/flutter_local_notifications/lib/src/platform_flutter_local_notifications.dart#L333
We can allow users to pass calledAt so that notification can be scheduled later with repeat. With this, we can achieve custom time for peridicallyShow What do you think? This can save a lot of time doing background fetch and other logic to schedule
Can this give notification at a particular date every year @manojeeva ?
This will help https://www.youtube.com/watch?v=aQTvI8L-mZs
Hello,apart from custom intervals is there some way to change the body everytime the periodicallyshow displays the notification every hour/minute/day. Like I am making a quote generator app which sends notifications every hour with a different quote, I have a function which return random quotes on callback, but for if I use periodically Display it just simple shows the first fetched quote from the callback function. Any way to do this?
Any updates?
https://github.com/MaikuB/flutter_local_notifications/blob/b7fa709a61207e9cd86b8d5be911c3b49b655776/flutter_local_notifications/lib/src/platform_flutter_local_notifications.dart#L333
We can allow users to pass calledAt so that notification can be scheduled later with repeat. With this, we can achieve custom time for peridicallyShow What do you think? This can save a lot of time doing background fetch and other logic to schedule
+1 I too need to be able to set the time when the notification should occur periodically. I just don't get, why there isn't a parameter for that, because the API apparently allows it...?