-
Notifications
You must be signed in to change notification settings - Fork 23
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
Update LocalNotifications.java #19
base: master
Are you sure you want to change the base?
Conversation
Fix Android Oreo issue.
@maverickmishra can you review this PR, merge it and release a new version of the plugin if everything looks good? |
String title = args.getString(0); | ||
String dir = args.getString(1); | ||
String lang = args.getString(2); | ||
String body = args.getString(3); | ||
String tag = args.getString(4); | ||
String icon = args.getString(5); | ||
|
||
String NOTIFICATION_CHANNEL_ID = "my_channel_id_01"; |
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.
This string is not used
@ithubdeveloper You will need to change the version of android here : https://github.com/ithubdeveloper/phonegap-plugin-local-notification/blob/patch-1/plugin.xml#L18 to :
|
NotificationCompat.Builder mBuilder = null; | ||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { | ||
int importance = NotificationManager.IMPORTANCE_DEFAULT; | ||
NotificationChannel notificationChannel = new NotificationChannel("ID", "Name", importance); |
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.
The channel should be named differently. Maybe id="default" and name="Default"? Also, just use NotificationManager.IMPORTANCE_DEFAULT
directly here rather than creating the importance
variable.
|
||
// Build notifications | ||
NotificationCompat.Builder mBuilder = | ||
new NotificationCompat.Builder(context) | ||
mBuilder = mBuilder |
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.
No need for the mBuilder =
here
Fix Android Oreo issue.
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: