Replies: 1 comment
-
@oyve if OnDestroy does not work. I do not have a good solution for this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is best practice to remove an ongoing notification when the user closes the app (outside the app)?
Example: User press the ||| button (Task Menu) on their phone. Current opened/paused apps will show, and you could choose to swipe-close your app from the list.
To close the actual notification I have tried using.
LocalNotificationCenter.Current.Clear(100);
This work in DEBUG mode on MainActivity:OnDestroy(), but not in RELEASE mode, as OnDestroy() doesn't seem to be called for this type of exit, and the notification will hang around until you either start the app again or uninstall it.
In MainActivity:OnPause() it will remove the notification, but user might not choose to close the app.
Xamarin/Android
Beta Was this translation helpful? Give feedback.
All reactions