This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
Move clearAllNotifications from pause to destroy #2913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notifications should persist when the app is moved to the background in order to draw the user back to re-activate the app when they are done multitasking.
Notifications should be destroyed when the app is closed though to avoid clutter.
This should also resolve:
ghenry22/cordova-plugin-music-controls2#7
Description
move the the clear all notifications call into onDestroy instead of onPause.
Related Issue
#2772
ghenry22/cordova-plugin-music-controls2#7
Motivation and Context
App notifications are still valid while the app is in the background, so it doesn't make sense to destroy all notifications as soon as the app is backgrounded. A lot of notifications are specifically to lead people to bring the app back to the foreground.
Also as this plugin clears ALL notifications from the app, even those generated by other plugins, it causes issues where other plugins need a persistent notification while in background (ie for music playback or voip).
How Has This Been Tested?
Tested in my own app and in a users app (as per the music-controls2 issue report)
Screenshots (if appropriate):
Types of changes
Checklist: