show_in_foreground is false but banner still showing when app is in foreground
See original GitHub issue“react”: “16.0.0-alpha.12”, “react-native”: “0.52.1”, “react-native-fcm”: “^14.1.3”
I don’t want to show banner when I push notifications from server.
I thought this show_in_foreground
would prevent it but it’s still showing when app is in foreground.
For local notification I made:
case NotificationType.WillPresent:
notif.finish(WillPresentNotificationResult.None)
But for remote notifications this is not enough. How to stop showing banner when in foreground? My use case is to show banner if app is not in foreground and do other things when it is.
This is how I send notification:
{
"to":"xxxxxxxxxxx",
"notification":
{
"title":"Title", "body":"Description", "sound":"default"},
"data":{"targetScreen":"details", "show_in_foreground": false},
"priority":10
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Displaying a stock iOS notification banner when your app is ...
But this behavior is seen in Apple's official Messages app: Messages is open and in the foreground. Still shows a notification alert. The...
Read more >Handling Notifications and Notification-Related Actions
A notification that arrives when your app is running in the foreground. ... Listing 1 shows an example that processes actions associated with...
Read more >Foreground services - Android Developers
Foreground services show a status bar notification, so that users are actively aware that your app is performing a task in the foreground...
Read more >SDK Notification Event Handlers - OneSignal Documentation
OneSignal SDK setNotificationWillShowInForegroundHandler method runs before displaying a notification while the app is in focus. Use this handler to decide if ...
Read more >Mobile Notification Package - Unity Forum
The package is still under development so if you have any feedback or ... Everything is working fine with the app in foreground,...
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
@vvusts if you don’t want notification to be shown, use
data
message?@evollu I did that and notification is not showing when app is in foreground. I need to make this also on android. EDIT: It actually work 😃 sorry