feat: Support for foreground "Pop on screen"/notification banner on Android
See original GitHub issueFeature Request
Describe the Feature Request
Android has a feature called “Pop on screen” which allows an app to show a banner with a notification. This is especially handy when the app is open (foreground) and you want to trigger a Local Notification. However, in the Push Notification implementation of Capacitor, this is not supported (there is support for iOS). Please add support for Android’s “Pop on screen” feature as well.
Platform Support Requested
- Android
- iOS
- Electron
- Web
Describe Preferred Solution
Ideally, the existing presentationOptions
of Capacitor’s Push Notifications config should also be respected by the Android version.
Describe Alternatives
We tried https://github.com/katzer/cordova-plugin-local-notifications, but it suffers from the same issue.
Related Code
Additional Context
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Notifications Overview | Android Developers
Appearances on a device · Status bar and notification drawer · Heads-up notification · Lock screen · App icon badge · Wear OS...
Read more >Control notifications on Android - Google Support
Notifications. Under “Recently Sent,” tap an app. Tap a type of notification. Choose your options: Choose Alerting or Silent. To see a banner...
Read more >Avoid notification popup peek when app is in foreground
Whenever I notify user, there will be a notification popup peek. ... popup peek, but only show a flashing icon in status bar....
Read more >How to view your notification history on Android - The Verge
Select “Widgets” from the pop-up menu. Scroll down and long-press the “Settings” widget, then place it on your home screen. You'll get a...
Read more >Firebase Notifications in Background & Foreground in Android
When the app is closed, your notifications are processed by the Google Service process, which take care of displaying your notifications as ...
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 FreeTop 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
Top GitHub Comments
Sorry for the late reply. I think the Ionic Team should add a note in their docs: PushNotifications received when the app is in the foreground don’t appear at all on Android.
Atleast you get the callback to send a LocalNotification instead, exactly how @Simbaclaws suggested.
@mccs0064 Here is my relevant code: