New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-24504] Android: Implement bundled notifications #9142
Conversation
@garymathews, your doc changes state that this feature is only supported on Android 7 and higher, but since we're using Google's NotificationCompat, the Java setGroup() and setGroupSummary() methods are (according to Google; link below) supposed to be supported on older Android OS versions as well. You may want to double check. Although, a stackoverflow post I've seen suggests that notification bundles via this compat library doesn't work on Android 4.0. |
Also, I think the "group" property should be renamed to "groupKey". This makes it clear to the reader that this property must be given a string key. Versus a name like "group" implies that it stores/provides a collection of items. I know what I'm suggesting doesn't match Google's equivalent Java method, but it does match how they document it. |
@jquick-axway Updated PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. And definitely a great feature to add.
Just 1 question and 1 minor change request left.
/** | ||
* @module.api | ||
*/ | ||
public static final String PROPERTY_GROUP_ALERT_BEHAVIOUR = "groupAlertBehaviour"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our APIs use American English spelling rules. So, we should rename "Behaviour" to "Behavior", without the 'u'. (Sorry)
This would match our spelling with iOS' notification behavior property...
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.App.iOS.UserNotificationAction-property-behavior
// remove FLAG_AUTO_CANCEL as this will prevent group notifications | ||
this.flags &= ~Notification.FLAG_AUTO_CANCEL; | ||
} | ||
notification.flags |= this.flags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding notification.flags |= this.flags
, is there a reason why you are changing it from an assignment to a bitwise-or operation? (Just curious in case there is something I'm not seeing here.)
I ask because the NotificationBuilder might set bits that can no longer be removed and the developer would have no means of clearing them. Versus the developer used to be able to set the exact flags he/she wanted before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind. The "Notification.Builder" sets flags (such as group summary) that we don't want to clear with an assignment.
@jquick-axway Updated |
FR Passed. The Studio Ver: 4.9.1.201707200100 |
TEST CASE
NOTE: this requires #9027
JIRA Ticket