-
-
Notifications
You must be signed in to change notification settings - Fork 699
Android Support Library + NotificationChannels #299
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
Conversation
Added support of NotificationChannels, with possibility to override him through protected createNotificationChannel of UploadTask class
Thanks for the PR! For those not familiar with the new Channels concept, here's the video. I have some questions and notes about your PR:
|
|
Added method setNotificationChannelForAllStatuses
Ok for the Regarding notification channels, I see that the user can still set four different channels for the four states. After some thinking, maybe the best would be to have a single notification channel for all the states, so I would move To allow custom notification channel creation, with all the customizations, I think the best would be to let the user create it outside the library and then just pass the if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String notificationChannelId = params.notificationConfig.notificationChannelId;
if (notificationChannelId == null) {
notificationChannelId = UploadService.NAMESPACE;
}
if (!notificationManager.getNotificationChannels().contains(notificationChannelId)) {
NotificationChannel channel = new NotificationChannel(notificationChannelId, "Upload Service channel", NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
}
} and remove createNotificationChannel method. In this way:
Forgot to tell you in previous comments that for the CI build to work you have to modify this line in
And this line to:
|
Seems fine for me. I will apply all necessary changes tomorrow. |
TravisCI fixed
Great! Thanks for the contribution 😃 |
Android Support Library is stable now, with compatible NotificationChannels from Android O... So I guess it's time to use them.