-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add constants for notification importance #1959
Conversation
Fix: indentation of Android code.
Documentation update, fix indentation
Adding mavenCentral() as jcenter() is shutting down
Adding mavenCentral() as jcenter() is shutting
Is this a change that you'd be willing to support? I'd be happy to update documentation as a part of this PR but didn't want to go through the effort if this is a change that is undesired. |
Hi @Mookiies |
17712b0
to
e61a5ef
Compare
Hey @Dallas62 I've updated the documentation and the PR is ready for review 😃 |
index.js
Outdated
@@ -604,4 +604,14 @@ Notifications.setNotificationCategories = function() { | |||
return this.callNative('setNotificationCategories', arguments); | |||
} | |||
|
|||
// https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT | |||
Notifications.IMPORTANCE = Object.freeze({ |
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.
A small change to follow the current case would be to rename IMPORTANCE
to Importance
(ucfirst).
For constant (MIN
, LOW
, ....) this is OK.
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.
👍 Done
README.md
Outdated
"unspecified" = NotificationManager.IMPORTANCE_UNSPECIFIED | ||
IMPORTANCE.DEFAULT = NotificationManager.IMPORTANCE_DEFAULT\ | ||
IMPORTANCE.HIGH = NotificationManager.IMPORTANCE_HIGH\ | ||
IMPORTANCE.LOW = NotificationManager.IMPORTANCE_LOW\ |
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.
There is some \
at the end of some line, is there any reason ?
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.
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.
Hi @Mookiies
I just check the PR, I don't see issue just format 😉
Thanks again for this PR !
Additionally add line breaks for visibility and priority options
@Dallas62 Made the rename change. Thanks for the quick review 😃 |
Hi @Mookiies |
Hi @Mookiies |
Constants come from: https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT
Adding these constants as an export would allow users of the library to have clearer code without floating numbers that require going to look at documentation to see what they mean.
This code
would become: