Skip to content
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

Using repeats: true in NotificationInterval sends a notification every second #628

Closed
doczi-dominik opened this issue Nov 1, 2022 · 28 comments
Labels
bug Something isn't working closed by bot This issue was automatically closed due to inactivity in discussion Waiting for customer response, e.g. more information was requested.

Comments

@doczi-dominik
Copy link

1 - Describe the bug

When creating a new scheduled notification using NotificationInterval object with its repeats property enabled, the actual schedule is ignored and the notification gets sent every second.

2 - Provide us as much information as possible

To help us to understand your issue, provide with your bug report all the relevant informations, such as:

  • Your plugins list inside the file pubspec.yaml (at least all notification plugins)
awesome_notifications: ^0.7.2
provider: ^6.0.4
scrollable_positioned_list: ^0.3.5
json_serializable: ^6.5.3
json_annotation: ^4.7.0
path_provider: ^2.0.11
equatable: ^2.0.5
  • What platform did you found the issue
    • Android
  • What devices did you found the issue
    • Xiaomi Mi 9T (Android 12)
  • How are you initializing the plugin
AwesomeNotifications().initialize(null, [
  NotificationChannel(
      channelKey: "channelKey",
      channelName: "Notes",
      channelGroupKey: "channelGroupKey",
      channelDescription: "Notes arranged by priority",
      defaultColor: Colors.red,
      defaultPrivacy: NotificationPrivacy.Private,
      criticalAlerts: true,
      importance: NotificationImportance.Max),
], channelGroups: [
  NotificationChannelGroup(
      channelGroupKey: "channelGroupKey", channelGroupName: "Notes")
]);
  • How are you creating the notification
final notifs = AwesomeNotifications();

await notifs.createNotification(
  content: NotificationContent(
      id: n.notificationID,
      channelKey: "channelKey",
      groupKey: "channelGroupKey",
      category: NotificationCategory.Reminder,
      locked: true,
      title: n.contents),
  schedule: NotificationInterval(
          interval: 120, repeats: true));
  • The output of flutter doctor command
[✓] Flutter (Channel stable, 3.3.5, on Arch Linux 6.0.2-arch1-1, locale en_US.UTF-8)
    • Flutter version 3.3.5 on channel stable at /home/doczid/Flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d9111f6402 (13 days ago), 2022-10-19 12:27:13 -0700
    • Engine revision 3ad69d7be3
    • Dart version 2.18.2
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /opt/android-sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /opt/android-sdk
    • ANDROID_SDK_ROOT = /opt/android-sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = chromium

[✓] Linux toolchain - develop for Linux desktop
    • clang version 14.0.6
    • cmake version 3.24.2
    • ninja version 1.11.1
    • pkg-config version 1.8.0

[✓] Android Studio (version 2021.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 213.7433
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Arch Linux 6.0.2-arch1-1
    • Chrome (web)    • chrome • web-javascript • Chromium 107.0.5304.87 Arch Linux

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

3 - How To Reproduce the Error

Steps to reproduce the behavior:

  1. Create a notification with a NotificationInterval schedule which has repeats enabled
  2. Wait a few seconds
  3. The notification should reappear every second or so, regardless of the set interval

4 - Expected behavior

Expected behaviour would be to send the notification after the provided interval has elapsed (like when repeats is set to false) but to reschedule the notification automatically, resulting in repeating notifications with interval seconds between them.

@doczi-dominik doczi-dominik added bug Something isn't working in triage This issue is waiting for first service response labels Nov 1, 2022
@rafaelsetragni rafaelsetragni added in discussion Waiting for customer response, e.g. more information was requested. and removed in triage This issue is waiting for first service response labels Nov 2, 2022
@rafaelsetragni
Copy link
Owner

Yes, it's a bug. A mistake of mine that I forgot to put the range variable for repetitions. I will publish a new release in a couple of hours with this fix. Thank you!

@aaort
Copy link

aaort commented Nov 14, 2022

So when can we expect new release with this issue resolved ?

@rafaelsetragni
Copy link
Owner

Until this Friday.

@huseyinseyit
Copy link

We are waiting, is there a method we can use instead? How to send a notification every day at a certain time?

@karthik24iyer
Copy link

Issue still persists, any idea please when we can get that bug resolved ?

@zees98
Copy link

zees98 commented Jan 24, 2023

Greetings @rafaelsetragni,
I hope you are having a great Tuesday. I required some insights into the issue so I could fix it myself. I have a task relying on this feature. I have gone through the file structure and made some changes to no avail.

I would appreciate it if you hint at a file in the project.

Thank you for this fantastic package and your hard work.

@karthik24iyer
Copy link

Greetings @rafaelsetragni, I hope you are having a great Tuesday. I required some insights into the issue so I could fix it myself. I have a task relying on this feature. I have gone through the file structure and made some changes to no avail.

I would appreciate it if you hint at a file in the project.

Thank you for this fantastic package and your hard work.

There is a branch called notification-interval-fix with some code changes, but that also did not resolve the jssue for me. Maybe you can take a look there for reference, and if you find some solution you can create PR :)

@zees98
Copy link

zees98 commented Jan 25, 2023

Thanks, @karthik24iyer.
I will pull the branch and have a look.

@josephmangmang
Copy link

Bug still exist

@booooohdan
Copy link

Any updates?

@Fethi-Hamdani
Copy link

issue still happening on latest version

@Fethi-Hamdani
Copy link

@rafaelsetragni any updates on this Sir

@niels-hubs
Copy link

niels-hubs commented Mar 9, 2023

I hav the exact same problem,
await AwesomeNotifications().createNotification( content: NotificationContent( id: id ?? createUniqueId(), channelKey: 'scheduled_channel', title: title, body: body, payload: payload, category: NotificationCategory.Reminder, wakeUpScreen: true, ), schedule: NotificationInterval( interval: interval, timeZone: localTimeZone, repeats: repeating, ), );

And it repeats every 25ms or so.... while the interval is set at 2 weeks 😢

@lead-SAP
Copy link

Hi everyone,

I would like to mention that this issue also occurs for me on a Pixel 6 device, however, the scheduling interval feature works fine on iOS devices.
@rafaelsetragni did you have enough time to look into this yet?

Regards,

@nshrefler-pssolutions
Copy link

This is also affecting NotificationCalendar

tested on Samsung S10e Android 12

@Dancas93
Copy link

Same issue on Android, on iOS it work properly.

@razfazz
Copy link

razfazz commented Mar 31, 2023

I have the same problem, I would not like to have to switch to the other package for it. Please fix!

@guyluz11
Copy link

guyluz11 commented Apr 27, 2023

Guy's please thumbs up this issue so that it will be clear how many developers it affects (Not this comment).

@guyluz11
Copy link

btw I can reproduce the bug even on version 0.7.0, lower than that I can't test because there isn't awesome_notifications_fcm compatible version.

@Fethi-Hamdani
Copy link

Fethi-Hamdani commented Apr 27, 2023

This is really a blocking issue that needs an urgent fix

@guyluz11
Copy link

guyluz11 commented Apr 28, 2023

Tested the branch notification-interval-fix and I can't reproduce, the fix works!

Unfortunately, I can't run the package from my fork, I am getting errors.
@rafaelsetragni can you share with us what is missing for this branch to get Marged to master, can we help with something?
And can you in the meantime upload a prerelease unstable version to pub.dev like easy_localization did?
image
It should be clear to people that the prerelease version sacrifices stability for new features.

The last update to the master branch was on Dec 28, 2022.
We should strive for small and focused updates, this way we can give feedback and work together to notice whenever there is regression.
Fixes for regression will be easier too since it will be easy to locate on small code version changes.

Thanks in advance for the awesome package, it is so a powerful tool that feels like magic 🪄

@rafaelsetragni
Copy link
Owner

Hi @doczi-dominik, @Fethi-Hamdani, @razfazz, @Dancas93, @nshrefler-pssolutions, @lead-SAP, @niels-hubs, @aaort, @karthik24iyer
and @huseyinseyit, i just uploaded the new release versions of 0.7.5-dev.2+1 versions of awesome_notifications and awesome_notifications_fcm to fix this issue. Please, check it out to see if this issue is solved on these new versions.

Also, don't forget to join in your Discord Beta team to request fixes and new updates.

@guyluz11
Copy link

Tested one 0.7.5-dev.2+1
Can be reproduced :(
This is a core feature of the package, please push a working fix to the stable version soon.

@github-actions
Copy link

This issue was automatically closed due inactivity, but can be reopened at any time.

@github-actions github-actions bot added the closed by bot This issue was automatically closed due to inactivity label Jul 24, 2023
@guyluz11
Copy link

Nope, should be open

@guyluz11
Copy link

@rafaelsetragni do you prefer that I will open a new issue about it?

@unoHdmedi
Copy link

I solved it by putting 0 in the second parameter.

@guyluz11
Copy link

I solved it by putting 0 in the second parameter.

Good to know there is a hack to make it work.

Nevertheless this is still issue that need to be fixed.
@rafaelsetragni you should re open the issue, @unoHdmedi just expired that so it is still reproducible in the last version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closed by bot This issue was automatically closed due to inactivity in discussion Waiting for customer response, e.g. more information was requested.
Projects
None yet
Development

No branches or pull requests