{ "id": "172388", "key": "TIMOB-26432", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-10-25T01:52:15.000+0000", "created": "2018-10-02T22:29:32.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [ { "id": "56942", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172488", "key": "TIMOB-26484", "fields": { "summary": "Android: Add \"sound\" support to NotificationChannel", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-26T08:26:58.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5.Steps to reproduce:\r\n1. Use the code below in your app.js:\r\n{code}\r\nvar channel = Ti.Android.NotificationManager.createNotificationChannel({\r\n id: 'my_channel',\r\n name: 'TEST CHANNEL',\r\n importance: Ti.Android.IMPORTANCE_DEFAULT\r\n }),\r\n notification = Titanium.Android.createNotification({\r\n \t\tcontentTitle: 'Notification 2',\r\n\t contentText : 'Just another notification',\r\n\t contentIntent: Ti.Android.createPendingIntent({intent: Ti.Android.createIntent({})}),\r\n\t icon: Ti.App.Android.R.drawable.warn,\r\n\t number: 5,\r\n\t when: new Date().getTime(),\r\n\t // Sound file located at /platform/android/res/raw/test.wav\r\n\t\tsound: Ti.Filesystem.getResRawDirectory() + 'test.wav',\r\n\t});\r\n\r\nsetInterval(function(){\r\n\tTi.Android.NotificationManager.notify(100, notification);\r\n}, 5000);\r\n{code}\r\n2. Build for android device/emulator.\r\n3. After the app launch you will get a local notification with custom sound every 5 seconds.\r\n\r\nh5.Actual results:\r\n1. On Android 7.0 & older the custom sound works fine.\r\n2. On Android 8.0+ the custom sound does not play but the default system notification sound plays.\r\n\r\nh5.Expected results:\r\n1. Custom sounds should play consistently on all Android versions.", "attachment": [], "flagged": false, "summary": "Android: Custom sounds are not played for local notifications on Android 8.0+", "creator": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Studio Ver: 5.1.1.201809051655\r\nSDK Ver: 7.4.1.v20180928073117\r\nOS Ver: 10.13.5\r\nXcode Ver: Xcode 9.4.1\r\nAppc NPM: 4.2.13\r\nAppc CLI: 7.0.6\r\nDaemon Ver: 1.1.3\r\nTi CLI Ver: 5.1.1\r\nAlloy Ver: 1.13.2\r\nNode Ver: 8.9.1\r\nNPM Ver: 5.5.1\r\nJava Ver: 10.0.2\r\nDevices: ⇨ google Nexus 5 (Android 6.0.1)\r\n ⇨ google Nexus 6P (Android 8.1.0)\r\n google Pixel (Android 9.0)\r\nEmulator: ⇨ Android 4.1.2, Android 7.1.1", "comment": { "comments": [ { "id": "442889", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This looks like an undocumented breaking-change on Google's end.\r\n\r\nI believe you're supposed to assign the custom sound to the notification channel now via the Java {{NotificaitonChannel.setSound()}} method and the sound assigned to individual notifications are now ignored.\r\n[NotificationChannel.setSound()|https://developer.android.com/reference/android/app/NotificationChannel.html#setSound(android.net.Uri,%20android.media.AudioAttributes)]\r\n\r\nThe problem with assigning the sound to the notification channel is that you can't change the sound file unless you delete and recreate the channel. Hmm...", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-23T22:31:36.000+0000", "updated": "2018-10-23T22:35:57.000+0000" }, { "id": "442894", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yeah, the Java {{Notification.Builder.setSound()}} method is definitely deprecated as can be seen here...\r\n[Notification.Builder.setSound()|https://developer.android.com/reference/android/app/Notification.Builder.html#setSound(android.net.Uri)]\r\n\r\nUnfortunately, it wasn't documented as deprecated on the Google support library side that we were using here...\r\n[NotificationCompat.Builder.setSound()|https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setsound]\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-23T23:44:20.000+0000", "updated": "2018-10-23T23:45:03.000+0000" }, { "id": "442930", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unfortunately, this issue cannot be *+fixed+*.\r\n\r\nThe solution is to provide a new feature where you can assign a \"sound\" to {{NotificationChannel}}. This will be implemented via: [TIMOB-26484]", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-25T01:50:40.000+0000", "updated": "2018-10-25T01:50:40.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }