Android changes: Modified behavior of the push notifications and added a new features. #11
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.
Description
This PR adds the changes for the following issues:
Issue Do-not-disturb support #2 : Added logic to request access to the user about modify the DO NOT DISTURB settings of the phone. Once the app has access then it will be able to redirect the user to the phone settings and let him add the "CORES Mobile" app to the exception rule of the phone, giving us the chance to override the sound and vibration settings on the phone when a push notification is received (logic implemented in the issue Custom sounds in the normal and critical push notifications #6).
Issue Notification grouping #3 : Added logic to create a notification grouper that will be displayed when there is more than 1 notification displayed in the Notification Drawer. This grouper will remove the existing and the incoming notifications to display a single item with the content of all of them.
Issue Remove notifications from OS tray when they are read in the Inbox page of CM #4 : Added a new function in the plugin to let the CORES Mobile app invoke it to remove notification from the notification drawer by a specific ID.
Issue Open Inbox Preview page #5 : Modified the listeners used to catch when a notification is received, pressed or dismissed to be able to open the "Inbox Preview" page of the CORES Mobile app and display the content of the notification.
Issue Custom sounds in the normal and critical push notifications #6 : Modified the function used to set behavior (sound, vibration and tap behavior) of the push notifications to flex them according to the type of the push notification received. There are 2 types:
Also, this PR includes a fix for the issue
https://github.com/havesource/cordova-plugin-push/issues/214
of the original repository of this plugin: Fixes the white icon displayed in the notification drawer when a push notification is received and displayed in the phone. Since there is no default icon, we are using the CORES Mobile icon that was added in the Android project when it is compilated.Related Issue
#2
#3
#4
#5
#6
Motivation and Context
These changes are a result of the features requested by T4M.
How Has This Been Tested?
These changes were tested using a real device with the following specs:
Screenshots (if appropriate):
Issue Do-not-disturb support #2 :
IMG_0569.mov
IMG_0570.mov
Issue Notification grouping #3 :
IMG_0573.mov
IMG_0571.mov
IMG_0574.mov
Issue Remove notifications from OS tray when they are read in the Inbox page of CM #4 :
IMG_0577.mov
IMG_0575.mov
Issue Open Inbox Preview page #5 :
IMG_0578.mov
IMG_0581.mov
IMG_0582.mov
IMG_0583.mov
Issue Custom sounds in the normal and critical push notifications #6 :
IMG_0586.MOV
Types of changes
Checklist: