Can't close Notification

Hello,

Currently I am developing an App, which plays Audio (also in Background).

[ using Xamarin Forms PCL and a Plugin "MediaManager" (with "MediaManager.Forms" etc.) ]

That Plugin supports an Implementation of a "Notification-Manager", which displays the current title, band etc. and you can play, pause, skip...

If I start playing a track, this Notification Manager shows the notification and works fine.
But at the moment you close the app (while the track is playing) the track stops playing, but the notification stays.

Also you cant close the notification or press play pause.
The only thing you can do is click on the whole notification to get back to the app (it starts a new instance of the app)

My thoughts so far:

1)
So far I figured out how to close that notification via code.
But there is no callback when the Android-App is closed (only when going in background).

~~Android has a class "MainApplication" with "OnTerminate" which sounds like something that could work - but it doesn't get called.
    (Just like OnDestroy in MainActivity or Dispose() with IDispose anywhere.)

(is there any event or smth. that I can use when the app gets closed?)

2)
Is there a way to say "user is always able to dismiss notification"?

Answers

Sign In or Register to comment.