{ "id": "171309", "key": "TIMOB-25864", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": [ { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-06-05T00:14:51.000+0000", "created": "2018-03-13T21:03:36.000+0000", "epic": { "id": 168063, "key": "TIMOB-24764", "name": "Android O: Implement support", "summary": "Android O: Implement support", "color": { "key": "color_8" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "android", "notification" ], "versions": [], "issuelinks": [ { "id": "56377", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "171284", "key": "TIMOB-25852", "fields": { "summary": "Android: Target API Level 26/27 by default", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "56581", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "171748", "key": "TIMOB-26102", "fields": { "summary": "Android: Push notifications should create default channel if not assigned when targeting Android 8", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-26T22:00:49.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": "*Summary:*\r\nIf an Android app targets API Level 26 or higher, notifications will fail to be posted to the status bar on Android 8.0 or higher unless they're assigned a notification channel as documented here...\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.NotificationChannel\r\n\r\nWe should modify notifications to auto-assign them the default notification channel if a channel was not already assigned by the developer. This way, when we modify Titanium to auto-target API Level 26 in the future (see ticket: [TIMOB-25852]), notifications will still work. Avoids a breaking change.\r\n\r\nNote that if the app targets API Level 25 or lower, Android 8 will auto-assign the notification the default channel for us.\r\n\r\n*Test:*\r\n# Set up \"tiapp.xml\" to target API Level 26 as shown below.\r\n# Build and run the below code on an Android 8 device.\r\n# Tap on the \"Send Notification\" button.\r\n# Verify that the notification was posted to the status bar.\r\n\r\n{code:xml}\r\n\r\n \r\n \r\n \t\t\r\n \r\n \r\n\r\n{code}\r\n\r\n{code:javascript}\r\nvar notificationId = 0;\r\nvar window = Ti.UI.createWindow();\r\nvar button = Ti.UI.createButton({ title: \"Send Notification\" });\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tvar notification = Ti.Android.createNotification(\r\n\t{\r\n\t\tcontentTitle: \"Content Title\",\r\n\t\tcontentText: \"Content Text\",\r\n\t\tcontentIntent: Ti.Android.createPendingIntent(\r\n\t\t{\r\n\t\t\tintent: Ti.Android.createIntent({}),\r\n\t\t}),\r\n\t});\r\n\tnotificationId++;\r\n\tTi.Android.NotificationManager.notify(notificationId, notification);\r\n});\r\nwindow.add(button);\r\nwindow.open();\r\n{code}\r\n\r\n*Recommended Solution:*\r\nThis should be implemented similar to the following \"aps_sdk\" library's PR here...\r\nhttps://github.com/appcelerator/aps_sdk/pull/307\r\n\r\n*Note:*\r\nThis is not an issue with our \"ti.cloudpush\" module. It already assigns a default channel to the received push notification.\r\n", "attachment": [], "flagged": false, "summary": "Android: Notifications should use default channel on Android 8 if not assigned", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "435728", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9945", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-19T19:57:38.000+0000", "updated": "2018-03-19T19:57:38.000+0000" }, { "id": "437855", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Found issue commented in the PR.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-22T18:37:20.000+0000", "updated": "2018-05-22T18:37:20.000+0000" }, { "id": "438110", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nPR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-05T00:14:45.000+0000", "updated": "2018-06-05T00:14:45.000+0000" }, { "id": "438740", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 7.3.0.v20180626064422.\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-06-26T22:00:41.000+0000", "updated": "2018-06-26T22:00:41.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }