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
pendingNotificationRequests returning null instead of a List on iOS #1287
Comments
Does that issue occurs only in real devices or in both device and simulator? |
Have only seen this on real devices, haven't been able to reproduce it ourselves. |
I'd need ways to reproduce a bug in order to investigate them. I suspect that you have other code that is scheduling notifications that is causing the problem and null safety has only surfaced up an existing problem. If so, you'd need to address this within your own app as you need to vet libraries you use to see if they achieve what you're after or if you need to implement your own native code. More specifically, the old iOS notification API doesn't expose the notification id as a standard field to be read when looking at pending notifications. It is something this plugin needed to put in as custom info (see https://developer.apple.com/documentation/uikit/uilocalnotification/1616657-userinfo) and is specific to this plugin |
I definitely agree that you should be able to reproduce it and I'll try to find a way to do that. That said, the inability of this library to return a list of pendingNotificationRequests() (regardless of where they were created), should be marked as a bug. Maybe the solution is to make the int id field nullable to account for such a case? |
What would be the use case here and what is the use case you have in your own app at the moment? |
As there's been no further response on how to reproduce this and my last question on the use case, this issue will be closed. Feel free to reopen if more info can be provided |
same issue on ios |
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'int' |
it should not return null , rather than empty list . |
In my case I am testing upgrading an existing native iOS app with a new flutter app. When the flutter app is installed, calling Perhaps id should be nullable as it is not so uncommon to rewrite an existing native app in flutter. but yes I can workaround it, with a |
This might be our issue. Switched from Xamarin lately. |
Describe the bug
Some iOS users are experiencing an error when
pendingNotificationRequests()
is called.To Reproduce
Unclear how to reproduce, only seems to occur since upgrading to null safety. iOS 12-14 users, iPhone and iPad.
Expected behavior
pendingNotificationRequests()
should return a list, not throw an exceptionSample code to reproduce the problem
FlutterLocalNotificationsPlugin().pendingNotificationRequests()
The text was updated successfully, but these errors were encountered: