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
[flutter_local_notifications] Add custom repeat interval - periodicallyShowWithDuration method #2197
base: master
Are you sure you want to change the base?
[flutter_local_notifications] Add custom repeat interval - periodicallyShowWithDuration method #2197
Conversation
Thanks for the PR. Will need time to give this one a good review compared to some other ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Got to test it out and works well. Besides the comment on the PR, do you think you'd be able to look at the following
- addressing the linter issues picked up by Dart analyzer
- I ran into the limitation you mentioned with Apple's APIs when the duration needs to be a minute. Rather than letting it run into a native exception that may not bubble up to be caught on the Dart side, could validation be added to ensure the duration is at least a minute on all the platform-specific implementations and throw an ArgumentError? This would allow checking the argument up-front. If you're not sure how to do it, it'd be similar to how the ID is validated to ensure it's within range where there's a
validateId()
call in the plugin
NotificationDetails notificationDetails, { | ||
String? payload, | ||
@Deprecated('Deprecated in favor of the androidScheduleMode parameter') | ||
bool androidAllowWhileIdle = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove androidAllowWhileIdle
argument? This is a new method so doesn't have to follow what's been done before and odd to add a new method with a deprecation notice applied to it immediately
Add an option to set custom time for periodically showed notifications.
The problem that I have encountered on iOS devices is that repeating interval must be set to 60 seconds minimum, but I don't think that is the problem for real use case scenarios.
Sample usage: