react-native-push-notification
react-native-push-notification copied to clipboard
Notification Tray does not popup when app is in foreground.
Hi All,
I have set up all the necessary things to get it working. I am using this library but when messages comes in foreground notification tray doesn't popup.
"@react-native-firebase/app": "^11.4.1", "@react-native-firebase/messaging": "^11.4.1", "react-native-push-notification": "^7.2.3",
Please help on this.
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="true"/>
enable this in your android manifest
I already try this still not working!!
any luck?
getting same issue. Any update? {"channelId": "Default", "color": null, "data": {some data}, "finish": [Function finish], "foreground": true, "id": "123", "message": "hello", "priority": "high", "sound": null, "tag": "some tag", "title": "some title", "userInteraction": false, "visibility": "private"} Above is my notification object when app is in foreground
you need to create channel at first before going to create local notification.
import PushNotification,{Importance} from "react-native-push-notification";
PushNotification.createChannel(
{
channelId: 'general',
channelName: 'General Notification',
importance: Importance.HIGH,
},
(result) => {
console.log(result);
},
);
Make sure you are not setting ignoreInForeground
to true