cordova-plugin-firebase-messaging
cordova-plugin-firebase-messaging copied to clipboard
Added support for notification channels
This is my first PR ever, so I apologize if I got it wrong.
I've brought the Android 6.x notification channel implementations forward to 7.x. That said, you still create a default channel called "Firebase" that would be nice to be able to skip based on some sort of config.
Anyway, I hope you find this useful.
-Gary
That said, you still create a default channel called "Firebase" that would be nice to be able to skip based on some sort of config.
If you don't want the Firebase channel you can comment out the below (FirebaseMessagingPluginService.java, line 57)
// On Android O or greater we need to create a new notification channel
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel defaultChannel = notificationManager.getNotificationChannel(defaultNotificationChannel);
if (defaultChannel == null) {
notificationManager.createNotificationChannel(
new NotificationChannel(defaultNotificationChannel, "Firebase", NotificationManager.IMPORTANCE_HIGH));
}
}
That said, you still create a default channel called "Firebase" that would be nice to be able to skip based on some sort of config.
If you don't want the Firebase channel you can comment out the below (FirebaseMessagingPluginService.java, line 57)
// On Android O or greater we need to create a new notification channel if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel defaultChannel = notificationManager.getNotificationChannel(defaultNotificationChannel); if (defaultChannel == null) { notificationManager.createNotificationChannel( new NotificationChannel(defaultNotificationChannel, "Firebase", NotificationManager.IMPORTANCE_HIGH)); } }
Thanks. I have a version where I did that. I mentioned it above b/c it would be nice to have the ability to turn it off via a config.xml setting.