{ "id": "172093", "key": "TIMOB-26319", "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": [ { "id": "20220", "name": "Release 7.3.1", "archived": false, "released": true, "releaseDate": "2018-08-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-08-21T07:11:14.000+0000", "created": "2018-08-20T06:25:43.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-21T10:54:20.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When using iOS 10+ on SDK 7.3.0, the \"usernotificationsettings\" event does not include the \"types\" array of granted types anymore. An easy workaround is to use the following code, but ideally it should be 100 % backwards compatible.\r\n\r\nWorkaround:\r\n{code:js}\r\nTi.App.iOS.NotificationCenter.requestUserNotificationSettings(event => {\r\n const alertSetting = event.alertSetting;\r\n const badgeSetting = event.badgeSetting;\r\n const soundSetting = event.soundSetting;\r\n \r\n if (alertSetting === Ti.App.iOS.USER_NOTIFICATION_SETTING_ENABLED) {\r\n // Alert allowed\r\n }\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: \"usernotificationsettings\" does not include \"types\" array on iOS 10 and SDK 7.3.0", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "440885", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10267\r\nPR (7_3_X): https://github.com/appcelerator/titanium_mobile/pull/10268\r\n\r\nTest-Case:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n // An action that opens the app (foreground action)\r\n var acceptAction = Ti.App.iOS.createUserNotificationAction({\r\n identifier: 'ACCEPT_IDENTIFIER',\r\n title: 'Accept',\r\n activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND,\r\n destructive: false,\r\n authenticationRequired: true\r\n });\r\n \r\n // An action that does not open the app (background action)\r\n var rejectAction = Ti.App.iOS.createUserNotificationAction({\r\n identifier: 'REJECT_IDENTIFIER',\r\n title: 'Reject',\r\n activationMode: Ti.App.iOS.USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND,\r\n destructive: true,\r\n authenticationRequired: false\r\n });\r\n \r\n // Create a notification category\r\n var downloadContent = Ti.App.iOS.createUserNotificationCategory({\r\n identifier: 'DOWNLOAD_CONTENT',\r\n actionsForDefaultContext: [ acceptAction, rejectAction ]\r\n });\r\n\r\n Ti.App.iOS.registerUserNotificationSettings({\r\n types: [\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT,\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE,\r\n Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND\r\n ],\r\n categories: [downloadContent]\r\n });\r\n});\r\n\r\nTi.App.iOS.addEventListener('usernotificationsettings', function (e) {\r\n // Verify that the \"types\" and \"categories\" are included\r\n Ti.API.warn(e);\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-08-20T07:03:45.000+0000", "updated": "2018-08-20T07:06:54.000+0000" }, { "id": "440929", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Verified fix with SDK version: {{7.3.1.v20180821020403}} and {{7.4.0.v20180820235132}}. \"usernotificationsettings\" now includes \"types\" array on iOS 10+ and SDK 7.3.0.\r\n\r\n# Created a titanium application with the test case above\r\n# Ran the program\r\n# Pressed the {{Trigger}} button on the application \r\n# Able to see the console log show more information (iOS 10+) (\"usernotificationsettings\" including \"types\" array) \r\n{code:java}\r\n[WARN] : {\r\n[WARN] : bubbles = 1;\r\n[WARN] : cancelBubble = 0;\r\n[WARN] : categories = (\r\n[WARN] : \"[object TiAppiOSUserNotificationCategory]\"\r\n[WARN] : );\r\n[WARN] : source = \"[object TiAppiOS]\";\r\n[WARN] : type = usernotificationsettings;\r\n[WARN] : types = (\r\n[WARN] : 4,\r\n[WARN] : 1,\r\n[WARN] : 2\r\n[WARN] : );\r\n[WARN] : }\r\n{code}\r\n# Previously only the following information would be seen on iOS 10+ (7.3.0.GA)\r\n{code:java}\r\n[WARN] : {\r\n[WARN] : bubbles = 1;\r\n[WARN] : cancelBubble = 0;\r\n[WARN] : source = \"[object TiAppiOS]\";\r\n[WARN] : success = 1;\r\n[WARN] : type = usernotificationsettings;\r\n[WARN] : }\r\n{code}\r\n\r\n*Test Environment*\r\n{code:java}\r\nAPPC Studio: 5.1.0.201808080937\r\nAPPC CLI: 7.0.5\r\niphone 6 simulator (11.2)\r\niphone 6 simulator (10.3)\r\niphone 6 simulator (9.3)\r\nOperating System Name: Mac OS High Sierra\r\nOperating System Version: 10.13\r\nNode.js Version: 8.9.1\r\nXcode 9.2\r\n{code}\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-21T10:54:09.000+0000", "updated": "2018-08-21T10:54:09.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }