Closed vvusts closed 6 years ago
Sorry I don't know why it is showing but can you tell How you are able to show the notification when app was open.
Can you share more code of listener and other parts. I'm trying to do that. Thanks. https://github.com/evollu/react-native-fcm/issues/909
@vvusts if you don't want notification to be shown, use data
message?
@evollu not like that. Server should send notification but if app is in foreground I should show alert instead of banner. Basically if app is in foreground alert and if app is closed or in background banner. Everything work fine there must be some trick to detect when notification arrived.
@sfm2222 what code part you want to see. I did everything like in doc and it worked.
try
{
"to":"xxxxxxxxxxx",
"notification":
{
"title":"Title", "body":"Description", "sound":"default"
},
"data":{"targetScreen":"details", "show_in_foreground": false},
"priority":10
}
@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
"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:
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: