Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26678] Android: Unnecessary default notification channel created when using a custom one

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2020-04-10T21:19:20.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.0.1
ComponentsAndroid
Labelsn/a
ReporterJeroen van Dijk
AssigneeGary Mathews
Created2018-11-28T22:40:21.000+0000
Updated2020-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.

Comments

  1. Joshua Quick 2018-11-28

    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).
  2. Jeroen van Dijk 2018-11-29

    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.
  3. Jeroen van Dijk 2018-11-29

    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.
  4. Joshua Quick 2018-11-30

    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?
  5. Jeroen van Dijk 2018-11-30

    Yes it is!
  6. Hans Knöchel 2019-12-17

    +1 for fixing the warning
  7. Gary Mathews 2020-02-25

    master: https://github.com/appcelerator/titanium_mobile/pull/11500
  8. Gary Mathews 2020-03-24

    9_0_X: https://github.com/appcelerator/titanium_mobile/pull/11559
  9. Samir Mohammed 2020-03-25

    FR Passed on Master. Waiting on Jenkins build.
  10. Christopher Williams 2020-03-27

    merged to master and 9_0_X
  11. Christopher Williams 2020-03-27

    merged to master and 9_0_X
  12. Satyam Sekhri 2020-04-10

    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,

JSON Source