Search code examples
angularionic-frameworknotificationsionic4

Pin notification icon with Ionic V4


I'm currently working on a Ionic V4 ( Angular ) project that includes Video conversation.

My purpose right now is to display a small Icon on the device's toolbar (where you can swipe down to view notificaitons) when the app is active. So that if someone leaves the app, they have a way of knowing they're still in a video conversation.

I used Notifications plugin, and when I push a notification it does display as intended, but if you clear the notification - the Icon goes away.

I've seen this feature in the Waze app (When you navigate somewhere and leave the app, you still have a badge on your toolbar)

Any idea how to obtain that kind of behavior?


Solution

  • I found the solution.

    When you create a notification - You can provide properties. When you assign 'sticky: true' the notification will be anchored.

    LocalNotifications GitHub Documentation