I\'m currently creating a foreground service with a notification that appears in the notification bar when the service starts. If the service stops, the notification dismiss
I did the following and it worked for me:
I created a notification before calling the foreground service with by same id and Notification Channel which are used with foreground service's notification
I canceled the notification by the notification id
I created another notification with your required structure
You can dismiss or swipe this last notification without stop your foreground service