-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for scheduling with repeating interval #25
Comments
Yep I was thinking about that but wasn't sure if many people use that feature :) |
can you provide more details about the scenario you're looking at? there are two options as far as i can tell
I'm guessing you're more interested in the second scenario as UNTimeIntervalNotificationTrigger doesn't seem to be appropriate for the first scenari?. The reason I ask is that the second scenario doesn't fit with the current method that's exposed for scheduling notifications so it'd most likely be a new method. From what I can gather, the second scenario can't be done on iOS versions 8.x and 9.x as well |
Thanks for looking into this. For now my use case is that following a specific event I schedule a notification 24 hours later, with a repeating 24 hour interval following that. So that even if the user does not act and dismiss the first notification, there will be another one the day after, and so on. A variant of this would be to schedule it at a specific time, say 3pm everyday. The native classes I mentioned in my initial comment are used in a project where only the first use case got implemented. Your first scenario seems to allow both use cases described above. I'm not sure I understand your second scenario. Do you mean it's only scheduling with an interval computed from the current date? In that case it could fit my first use case, but not the second one. |
An example of the second displaying a notification every hour, this sounds like your first use case. The second use case you gave sounds like something that could be added as extension of the existing |
I've released a new version that I believe should handle the first scenario you described. Whilst doing this,I couldn't find a good abstraction for the second scenario so I don't think that's going be handled in this plugin. I suggest you grab a local copy of the plugin's code, reference it in your application and tweak it to your needs |
I tried the new release, and it looks like the Hourly & Daily intervals are switched, e.g. setting up notifications with Hourly but receiving them Daily. From a quick look at the code, I guess it's because the enum order in lib/flutter_local_notifications.dart does not match the order in the platform specific FlutterLocalNotificationsPlugin.m and RepeatInterval.java |
Ok thanks I'll take a look at it. Was this on iOS or Android?
Edit: doh nvm, saw it. thanks for picking up on that
|
Released a new version with the fix now |
Going to close this off. If you run into another bug, then you can open another issue :) |
It would be nice to be able to schedule repeating notifications (something like UNTimeIntervalNotificationTrigger on iOS / AlarmManager.setInexactRepeating() on Android).
The text was updated successfully, but these errors were encountered: