Skip to content
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

Added support for notification channels #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grumpygary
Copy link

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

@fredriksthlm
Copy link

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));
            }
        }

@grumpygary
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants