Android: Silent error when displaying notification and maximum reached
See original GitHub issueDepending on the android version there is a maximum number of notifications that can be posted to the device. Sometimes 50 sometimes 24. Some manufacturers can even set a different number.
There is no way to query this value (MAX_PACKAGE_NOTIFICATIONS
).
An error is thrown natively but is not bubbled up to javascript when awaiting notifee.displayNotification
, it fails silently.
Only solution I found so far is to get (await notifee.getDisplayedNotifications()).length;
before and after calling displayNotification
, then cancel a notification and retry after that.
Would be nice to avoid doing the get before and after and just have an error and handle it.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to Fix Android Messages Having No Notification Sound
How to fix Android's default Messages app having no notification sound for incoming text messages, even with ringer volume set to maximum.
Read more >How to Fix Data Warning Issue in Android Phone - YouTube
Remove Data Warning Notification in Android Phone #DataWarning #AndroidPhone #MobileData Facebook Page ...
Read more >16 Ways to Fix Text Message Notifications Not Working on ...
Facing issues related to the text message notifications on Android? Here are a few ways to fix notifications not working on Android phones....
Read more >Android notification is not showing - Stack Overflow
Your notification is not showing, because you didn't provide an icon. Even though the SDK documentation doesn't mention it being required, it is ......
Read more >Control notifications on Android - Google Support
Silent : Your phone won't make a sound or vibrate. But the notification will show up when you swipe down from the top...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What do you think about posting the notification then post-checking the current displayed list to see if it actually went in? Then our API could at least indicate success or failure? Just brainstorming though, admittedly. Trying to see if there is any signal we could squeeze out
Interesting - it is hard to get a stacktrace because the assertion that it “silently throws” is incorrect - there is no throw, so there is no stacktrace. It’s silently dropping them, that’s different. (the link to the source was critical in examining this - thanks)
I’m not sure how to handle this then, other than your method of getting the list first, posting, then checking the list again. That should work but there’s the chance the user interacts with a notification (clearing one or more) or that the app in another thread does something (javascript is not multi-threaded but firebase-android-sdk is and if you receive an FCM with a notification block it may attempt to post). So just doing a count is not sufficient I think
I have not worked in this repo in a while so my memories are growing vague but I think there is the idea of a notification ID, it should be able to verify the specific ID you expect is in the list after posting it?