-
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
Notifications not getting scheduled #1378
Comments
Thanks will take a look. My first guess would be it would be due to this PR With what you described though, I believe the notifications should still be scheduled and that the issue is that the results from finding the pending active notifications is incorrect as that data comes from reading from shared preferences as Android doesn't actually have an API specific to scheduling notifications or an API to query which ones are scheduled |
Unfortunately I can't reproduce this on my own device (Pixel 6) or emulator. I am trying to source a cheaper device with lower specs but would take some time to arrive though I don't know it would help with reproducing the issue. What device/emulator were you testing this on and could you include the output of running One thing I would suggest trying is to see if you can fork this repo, make changes to how data is saved to shared preferences so it's done similar to how the Flutter shared_preferences plugin does this (see https://github.com/flutter/plugins/blob/5bf7fb0360aa70571c46d5b0ac64949fc81a0dfd/packages/shared_preferences/shared_preferences/android/src/main/java/io/flutter/plugins/sharedpreferences/MethodCallHandlerImpl.java#L137) to see if it'll fix the issue |
I am using a Pixel 3a Android 12 emulator on an M1 Macbook Air. Here is the Flutter doctor output:
Will see if I can reproduce it on an actual device. Edit: If I understand correctly, the only way to get the ID of a notification is to set it yourself and/or rely on the |
That or you can include it in the payload. You could serialise the content that matters to you as a JSON string.
|
FYI whilst I've not heard, I've released 9.1.1 with the changes as it looked fine from my own testing |
I can not recreate the issue with 9.1.2, but in 9.1.3 its back again, which is what I would have expected.... |
@mk-dev-1 could you help test a fix that I've got in the You should be able to use a Git dependency by specifying the following in your pubspec.yaml file
|
Will try to test over the weekend |
Any updates on this? |
@mk-dev-1 did you get to test branch? |
@Ahemad7429 you could also help by test by using the branch I've mentioned |
The following may relate to this: #1448 I can show the above problem in the emulator, so I'll test the branch from this thread. |
sorry for reporting too soon so I changed version but did not use flutter clean after that it was showing updated IDs. Hello i am trying to schedule like 6 notifications at same time in for loop but it gives wrong pendingNotificationList length so i added like 100ms delay now it shows correctly should i open another issue? |
You should bump your dependency first. 9.2.0 isn't the version with the fix. GitHub should've showed which PR closed this issue. You can also subscribe to the repo to find out when there are new releases |
yp
yes I am using latest dependency, Okay I will subscribe Thanks for reply 😄 . |
Describe the bug
When scheduling multiple notifications in a row, individual notifications get swallowed (i.e. do not get scheduled). When adding a tiny delay of 15ms everything is working as expected.
As far as I can see this issue started appearing with one of the latest revisions. I had trouble recreating the issue consistently, particularly as in my app I was running the scheduling routines asyncronously and even in separate isolates. When creating this simple test app, I could consistently reproduce the issue every time.
To Reproduce
Expected behavior
Expecting to see all notifications scheduled
Sample code to reproduce the problem
https://github.com/mk-dev-1/flutter_local_notifications_sample/blob/master/lib/main.dart
The text was updated successfully, but these errors were encountered: