[TIMOB-26678] Android: Unnecessary default notification channel created when using a custom one
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-04-10T21:19:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.1 |
Components | Android |
Labels | n/a |
Reporter | Jeroen van Dijk |
Assignee | Gary Mathews |
Created | 2018-11-28T22:40:21.000+0000 |
Updated | 2020-04-10T21:19:20.000+0000 |
Description
When using SDK 7.5.0.GA and targeting Android SDK version 26 there is a small issue with notifications.
In TIMOB-25864 forward compatibility was introduced to have a default channel in case apps target SDK version 26. This works perfect, apart from the fact that it now always creates this channel.
When using the (undocumented) 'channelId' as option in the createNotification after creating a custom notification channel this yields the expected result. You see a notification that belongs to the channel just created, but on top that you still see the warning:
[WARN] TiNotification: (main) [234,27512] Falling back to default notification channel.
[WARN] TiNotification: It is highly advised to create your own notification channel using Ti.Android.NotificationManager.createNotificationChannel()
This occurs with the example code of NotificationChannel when targeting SDK version 26: https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.NotificationChannel
Expected result:
No default notification channel is created, when a custom notification channel is defined.
You definitely can create your own notification channel for local notifications. We've tested it in 7.5.0 when adding sound support to local notifications channels. Please see the "NotificationSoundTest.js" attached to [TIMOB-26484]. The test procedure for this can be found [here](https://github.com/appcelerator/titanium_mobile/pull/10400).
That's correct. I'm not saying that the creation of the notification channel is the problem. I can perfectly see that happening. But using the created channel is somehow failing for me. In my case I explicitly don't use sounds for notifications, because of a solution using background audio that informs users in the same way when running either in the foreground or background.
Okay [~jquick], you're right. It works as expected. I was just using the wrong importance on my custom channel due to that I heard an extra sound. But I was under the impression that that was triggered by the default channel that is created. So there still is a minor issue. Now a default channel is 'always' created, even when you use a custom channel. This shouldn't be necessary. I've updated the description to reflect this problem.
Oh I see. That default channel warning/creation shouldn't be happening. Sorry about the confusion. Is everything else notification-wise working out for you?
Yes it is!
+1 for fixing the warning
master: https://github.com/appcelerator/titanium_mobile/pull/11500
9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11559
FR Passed on Master. Waiting on Jenkins build.
merged to master and 9_0_X
merged to master and 9_0_X
Verified on: Mac OS: 10.15.4 SDK: 9.0.1.v20200409100807, 9.1.0.v20200409073825 Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202003132109 Device: Pixel3(v10.0) emulator,