Skip to content

Heads up Notification not working when App is in background #2547

@jerryheir

Description

@jerryheir

I have gone through all the related issues and I cant find any real solution to this. Even the documentation doesn't answer it but points to a google documentation.

The user's activity is in fullscreen mode (the app uses fullScreenIntent).
The notification has high priority and uses ringtones or vibrations on devices running Android 7.1 (API level 25) and lower.
The notification channel has high importance on devices running Android 8.0 (API level 26) and higher.

I HAVE DONE ALL THE ABOVE, I added , but still does not work the way other apps notify me when I am in another app. My code is below.

    const channel = new firebase.notifications.Android.Channel('test-channel', 'Test Channel', firebase.notifications.Android.Importance.High)
    .setDescription('My apps test channel')
    .setSound('default')
    .enableLights(true)
    .enableVibration(true);
    await firebase.notifications().android.createChannel(channel);
    this.notificationListener = await firebase.notifications().onNotification((notification) => {
        if (Platform.OS === "android") {
          notification
          .android.setChannelId('test-channel')
          .android.setSmallIcon('transwr')
          .android.setColor('#BE64FF')
          .android.setAutoCancel(true)
          .android.setPriority(firebase.notifications.Android.Priority.High).setSound('default');
        }
        firebase.notifications().displayNotification(notification);
    });

Please I have done everything
It works in the foreground but when I go to another app, I get the sound and see the icon on the status bar but it does not pop up

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: StaleIssue has become stale - automatically added by Stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions