Not able to receive heads-up (floating) notification when app is in background or foreground

Hello, I want to show heads up (floating) notification when my app receives any notification. I have set the priority of notification as HIGH, but still not able to receive heads-up notification.
Please note: I am able to receive notification in notification tray
Kindly help.

const channel = new firebase.notifications.Android.Channel(‘fcm_FirebaseNotifiction_default_channel’, ‘Demo app name’, firebase.notifications.Android.Importance.High)
.setDescription(‘Demo app description’)
.setSound(‘sampleaudio.wav’)
firebase.notifications().android.createChannel(channel);

    this.notificationListener = await firebase.notifications().onNotification((notification) => {
        const { title, body } = notification;
        const localNotification = new firebase.notifications.Notification({
            sound: 'sampleaudio',
            show_in_foreground: true,
        })
            .setSound('sampleaudio.wav')
            .setNotificationId(notification.notificationId)
            .setTitle(notification.title)
            .setBody(notification.body)
            .setData(notification.data)
            .android.setAutoCancel(true)
            .android.setChannelId('fcm_FirebaseNotifiction_default_channel') 
            .android.setSmallIcon('ic_launcher')
            .android.setLargeIcon('ic_launcher')
            .android.setPriority(firebase.notifications.Android.Priority.High);
        firebase.notifications()
            .displayNotification(localNotification)
            .catch(err => console.error(err));

    });

“react-native”: “0.59.8”,
“react-native-firebase”: “^5.5.6”,

1 possible answer(s) on “Not able to receive heads-up (floating) notification when app is in background or foreground

  1. Notifications in react-native-firebase is a dead-end, support for local notification APIs was removed in react-native-firebase v6 and RNFBv5 isn’t receiving support any more, it’s time to upgrade react-native-firebase (and react-native if you are on 0.59), and integrate a supported notifications package (react-native-notifications or notifee or similar)

Not able to receive heads-up (floating) notification when app is in background or foreground

Hello, I want to show heads up (floating) notification when my app receives any notification. I have set the priority of notification as HIGH, but still not able to receive heads-up notification.
Please note: I am able to receive notification in notification tray
Kindly help.

const channel = new firebase.notifications.Android.Channel(‘fcm_FirebaseNotifiction_default_channel’, ‘Demo app name’, firebase.notifications.Android.Importance.High)
.setDescription(‘Demo app description’)
.setSound(‘sampleaudio.wav’)
firebase.notifications().android.createChannel(channel);

    this.notificationListener = await firebase.notifications().onNotification((notification) => {
        const { title, body } = notification;
        const localNotification = new firebase.notifications.Notification({
            sound: 'sampleaudio',
            show_in_foreground: true,
        })
            .setSound('sampleaudio.wav')
            .setNotificationId(notification.notificationId)
            .setTitle(notification.title)
            .setBody(notification.body)
            .setData(notification.data)
            .android.setAutoCancel(true)
            .android.setChannelId('fcm_FirebaseNotifiction_default_channel') 
            .android.setSmallIcon('ic_launcher')
            .android.setLargeIcon('ic_launcher')
            .android.setPriority(firebase.notifications.Android.Priority.High);
        firebase.notifications()
            .displayNotification(localNotification)
            .catch(err => console.error(err));

    });

“react-native”: “0.59.8”,
“react-native-firebase”: “^5.5.6”,

1 possible answer(s) on “Not able to receive heads-up (floating) notification when app is in background or foreground

  1. Notifications in react-native-firebase is a dead-end, support for local notification APIs was removed in react-native-firebase v6 and RNFBv5 isn’t receiving support any more, it’s time to upgrade react-native-firebase (and react-native if you are on 0.59), and integrate a supported notifications package (react-native-notifications or notifee or similar)

Not able to receive heads-up (floating) notification when app is in background or foreground

Hello, I want to show heads up (floating) notification when my app receives any notification. I have set the priority of notification as HIGH, but still not able to receive heads-up notification.
Please note: I am able to receive notification in notification tray
Kindly help.

const channel = new firebase.notifications.Android.Channel(‘fcm_FirebaseNotifiction_default_channel’, ‘Demo app name’, firebase.notifications.Android.Importance.High)
.setDescription(‘Demo app description’)
.setSound(‘sampleaudio.wav’)
firebase.notifications().android.createChannel(channel);

    this.notificationListener = await firebase.notifications().onNotification((notification) => {
        const { title, body } = notification;
        const localNotification = new firebase.notifications.Notification({
            sound: 'sampleaudio',
            show_in_foreground: true,
        })
            .setSound('sampleaudio.wav')
            .setNotificationId(notification.notificationId)
            .setTitle(notification.title)
            .setBody(notification.body)
            .setData(notification.data)
            .android.setAutoCancel(true)
            .android.setChannelId('fcm_FirebaseNotifiction_default_channel') 
            .android.setSmallIcon('ic_launcher')
            .android.setLargeIcon('ic_launcher')
            .android.setPriority(firebase.notifications.Android.Priority.High);
        firebase.notifications()
            .displayNotification(localNotification)
            .catch(err => console.error(err));

    });

“react-native”: “0.59.8”,
“react-native-firebase”: “^5.5.6”,

1 possible answer(s) on “Not able to receive heads-up (floating) notification when app is in background or foreground

  1. Notifications in react-native-firebase is a dead-end, support for local notification APIs was removed in react-native-firebase v6 and RNFBv5 isn’t receiving support any more, it’s time to upgrade react-native-firebase (and react-native if you are on 0.59), and integrate a supported notifications package (react-native-notifications or notifee or similar)