Search code examples
androidangularionic-frameworknotificationsionic4

Notification showing only in topbar


i'm getting push notifications from onesignal, but when i get a push notification from onesignal or a local notification from LocalNotifications cordova plugin using trigger, in both cases i see the notification only in topbar, like this:

enter image description here

and if i have the device in background (non-active), i have the same issue... the issue is that when i receive the notification, i'm not receiving the notification like this:

enter image description here

i know that the above image is the notification display for ios, but android have a similar style to display the notification like the above image, i'm never getting the notification like that i'm only receiving the notification in topbar (pushing the icon of the app), and i think that may be is a preference or a thing is needed to add in config.xml file or something like that... (my device support that notification style), but i don't know what is it...

here are some additional information:

cordova-android: 8.1.0
ionic CLI version: 5.2.7

device:

android version: 9.0

Solution

  • When we have to display floating notification on screen like whats app and others they did we need to ask for permission to users.

    <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />