Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26484] Android: Add "sound" support to NotificationChannel

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2018-10-26T19:33:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsandroid, notification, sound
ReporterJoshua Quick
AssigneeJoshua Quick
Created2018-10-25T01:49:10.000+0000
Updated2018-10-29T19:43:32.000+0000

Description

*Summary:* Android 8.0 and newer OS versions ignore the "sound" property assigned to individual notifications. The only way to play custom notification sounds is to assign the sound to a NotificationChannel instead. See sample code [^NotificationSoundTest.js] for an example on how this would work. Note that you must assign the custom sound to both the Notification (for Android 7.1 and below) and the NotificationChannel (for Android 8.0 and above). It's a bummer that you have to assign it to both, but that's the only solution if you want to support customer sound on OS versions older than Android 8.0.

Attachments

FileDateSize
notification_sound.wav2018-10-25T01:45:56.000+0000118828
NotificationSoundTest.js2018-10-25T01:48:17.000+00001204

Comments

  1. Joshua Quick 2018-10-25

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10400
  2. Lokesh Choudhary 2018-10-26

    FR Passed. PR Merged.
  3. Keerthi Mahalingam 2018-10-29

    Verified the fix on SDK 7.5.0.v20181026152809. Notification sound works as expected.Closing.
       Operating System
         Name                        = Mac OS X
         Version                     = 10.13.6
         Architecture                = 64bit
       Node.js
         Node.js Version             = 8.12.0
         npm Version                 = 6.4.1
       Titanium CLI
         CLI Version                 = 5.1.1
       Studio			      =5.1.2.201810080801
       Titanium SDK
         SDK Version                 = 7.5.0.v20181026152809
       Device                        = Samsung s5 Android 6, pixel android 9 
       Emulator		       = Samsung galaxy s6 android 6
       

JSON Source