[TIMOB-26484] Android: Add "sound" support to NotificationChannel
| GitHub Issue | n/a |
| Type | New Feature |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-10-26T19:33:00.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.5.0 |
| Components | Android |
| Labels | android, notification, sound |
| Reporter | Joshua Quick |
| Assignee | Joshua Quick |
| Created | 2018-10-25T01:49:10.000+0000 |
| Updated | 2018-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
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10400
FR Passed. PR Merged.
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