Reputation: 336
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:
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:
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
Upvotes: 1
Views: 955
Reputation: 2464
For recent Android versions, you must play with android channels that is also called "categories". If the category is "urgent", the push will pops above the screen (app closed or active), which is called "floating push".
See the OneSignal Android notification categories doc
Upvotes: 0
Reputation: 4782
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" />
Upvotes: 1