react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

Notification Tray does not popup when app is in foreground.

Open ravi123saxena opened this issue 3 years ago • 6 comments

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.

ravi123saxena avatar May 12 '21 04:05 ravi123saxena

<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="true"/> enable this in your android manifest

PrabhakarKotipalli avatar May 20 '21 06:05 PrabhakarKotipalli

I already try this still not working!!

ravi123saxena avatar May 20 '21 17:05 ravi123saxena

any luck?

yasir-syed avatar May 30 '21 20:05 yasir-syed

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

Aexonic-Abhishek avatar Jun 12 '21 06:06 Aexonic-Abhishek

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);
          },
        );

hai-ru avatar Jun 13 '21 17:06 hai-ru

Make sure you are not setting ignoreInForeground to true

syedrahaman92 avatar Jun 03 '22 08:06 syedrahaman92