{ "id": "161694", "key": "TIMOB-23627", "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": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-09-12T17:42:37.000+0000", "created": "2016-07-12T12:46:24.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios10", "permissions", "qe-5.5.0" ], "versions": [], "issuelinks": [ { "id": "52714", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "163151", "key": "TIMOB-23889", "fields": { "summary": "iOS: App crashes on iOS 10 when calling Permisson's methods", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-09-12T18:44:43.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": "Apps built with iOS 10 and Xcode 8 can crash when the user accesses different API's (Camera, Calendar & Contacts). After some research, this is because iOS 10 and later required the following keys that have been introduced back in iOS 6:\r\n- {{NSContactsUsageDescription}}\r\n- {{NSCameraUsageDescription}}\r\n- {{NSCalendarsUsageDescription}}\r\n- {{NSMicrophoneUsageDescription}}\r\n\r\nThey are similar to the {{NSLocationWhenInUseUsageDescription}} and {{NSLocationAlwaysUsageDescription}} keys that need to be added to the plist. So this issue is more a docs ticket which we need to update and mention in the 6.0.0 release notes, so people know to add these keys.\r\n\r\nFurther links: \r\n- https://developer.apple.com/library/prerelease/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html\r\n- https://forums.developer.apple.com/thread/51239", "attachment": [], "flagged": false, "summary": "Calendar, Contacts and Camera can crash on iOS 10 / Xcode 8", "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, "closedSprints": [ { "id": 678, "state": "closed", "name": "2016 Sprint 14 SDK", "startDate": "2016-07-02T00:25:57.921Z", "endDate": "2016-07-16T00:25:00.000Z", "completeDate": "2016-07-18T03:18:29.729Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "390590", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8130", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-13T08:21:24.000+0000", "updated": "2016-07-13T08:21:24.000+0000" }, { "id": "392090", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Reopening to additionally throw a warning if users don't have the keys when using iOS 10+.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-01T05:48:48.000+0000", "updated": "2016-08-01T05:48:48.000+0000" }, { "id": "392092", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8181\r\n\r\nSteps to test:\r\n1. Run the following demo-code on iOS 9:\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: \"#FFFFFF\",\r\n layout: \"vertical\"\r\n});\r\n\r\nvar camera = Titanium.UI.createButton({\r\n title: \"Request video permissions (camera, microphone & gallery)\",\r\n top: 40\r\n});\r\n\r\nvar contacts = Titanium.UI.createButton({\r\n title: \"Request contacts permissions\",\r\n top: 40\r\n});\r\n\r\nvar calendar = Titanium.UI.createButton({\r\n title: \"Request calendar permissions\",\r\n top: 40\r\n});\r\n\r\nvar audio = Titanium.UI.createButton({\r\n title: \"Request audio permissions\",\r\n top: 40\r\n});\r\n\r\ncamera.addEventListener(\"click\", function(e) {\r\n if (!Ti.Media.hasCameraPermissions()) {\r\n Ti.Media.requestCameraPermissions(takeVideo);\r\n } else {\r\n takeVideo();\r\n }\r\n});\r\n\r\ncontacts.addEventListener(\"click\", function() {\r\n Ti.Contacts.requestContactsPermissions(function(e) {\r\n Ti.API.warn(\"Contacts permissions granted? \" + e.success);\r\n });\r\n});\r\n\r\ncalendar.addEventListener(\"click\", function() {\r\n Ti.Calendar.requestCalendarPermissions(function(e) {\r\n Ti.API.warn(\"Calendar permissions granted? \" + e.success);\r\n });\r\n});\r\n\r\naudio.addEventListener(\"click\", function() {\r\n Ti.Media.requestAudioPermissions(function(e) {\r\n Ti.API.warn(\"Audio permissions granted? \" + e.success);\r\n });\r\n});\r\n\r\nwin.add(camera);\r\nwin.add(contacts);\r\nwin.add(calendar);\r\nwin.add(audio);\r\nwin.open();\r\n\r\nfunction takeVideo() {\r\n Ti.Media.showCamera({\r\n success: function(e) {\r\n Ti.API.info(\"Video captured successfully!\");\r\n },\r\n error: function(e) {\r\n alert(\"There was an error\");\r\n },\r\n cancel: function(e) {\r\n alert(\"The event was cancelled\");\r\n },\r\n allowEditing: true,\r\n saveToPhotoGallery: true,\r\n mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],\r\n videoQuality: Ti.Media.QUALITY_HIGH\r\n });\r\n}\r\n{code}\r\n2. No error-logs should appear, the user should be asked for permissions like before\r\n3. Run the same code on iOS 10\r\n4. The app should crash when not having the required keys included\r\n5. Include the following keys in the plist-section of your tiapp.xml:\r\n{code:xml}\r\nNSCameraUsageDescription\r\nCan we use your camera?\r\nNSMicrophoneUsageDescription\r\nCan we use your microphone?\r\nNSPhotoLibraryUsageDescription\r\nCan we save to your library?\r\nNSCalendarUsageDescription\r\nCan we use your calendar?\r\nNSContactsUsageDescription\r\nCan we use to your contacts?\r\n{code}\r\n6. Run the app on iOS 10 again\r\n7. The app should not crash anymore and the usage-descriptions in the tiapp.xml should be displayed in the authorization-dialogs.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-01T06:22:31.000+0000", "updated": "2016-08-01T09:10:37.000+0000" }, { "id": "393090", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (5_5_X): https://github.com/appcelerator/titanium_mobile/pull/8222", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-14T10:08:47.000+0000", "updated": "2016-08-14T10:08:47.000+0000" }, { "id": "393197", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "I am getting an error on an iOS 9.3.1 and 10 device when {{Request video permissions (camera, microphone & gallery)}} Is clicked.\r\n\r\nh4. Steps to reproduce.\r\n# Download SDK {{5.5.0.v20160815094515}}\r\n# Run sample app.js above\r\n# Click {{Request video permissions (camera, microphone & gallery)}}\r\n\r\n{color:red}I tested this using {{6.0.0.v20160810073036}} and the error was not thrown.{color}\r\n\r\nh4. Error\r\n{noformat}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 819;\r\n[ERROR] : line = 1;\r\n[ERROR] : message = \"+[TiUtils isIOS10OrGreater]: unrecognized selector sent to class 0x10056a848\";\r\n[ERROR] : sourceURL = \"file:///var/containers/Bundle/Application/5D074778-C4F2-4D20-B6DD-DDBA6A7D0243/TIMOB-23627.app/app.js\";\r\n[ERROR] : stack = \"[native code]\\nfile:///var/containers/Bundle/Application/5D074778-C4F2-4D20-B6DD-DDBA6A7D0243/TIMOB-23627.app/app.js:1:819\";\r\n[ERROR] : }\r\n{noformat}\r\n\r\n*Reopening*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-08-15T18:16:01.000+0000", "updated": "2016-08-15T18:16:01.000+0000" }, { "id": "393200", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "All good, that was a problem with the backport I fixed as part of https://github.com/appcelerator/titanium_mobile/pull/8227 because I hoped [~apetkov] can merge it asap. As soon as it is merged (and [this commit|https://github.com/appcelerator/titanium_mobile/pull/8227/commits/7fdd260291840f61bb678caec0b261f7357256d0]) it will work.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-15T18:38:11.000+0000", "updated": "2016-08-15T18:38:11.000+0000" }, { "id": "393206", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~jlongton] Please try 5.5.0.v20160815115302, thanks.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-15T20:19:45.000+0000", "updated": "2016-08-15T20:19:45.000+0000" }, { "id": "393298", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, thanks [~hansknoechel]\r\n\r\nh4. Tested on\r\n{noformat}\r\niPhone 6s plus (9.3.1)\r\niPhone 6 (10.0)\r\niPhone Simulator (10.0)\r\n
Mac OSX El Capitan 10.11.6\r\nStudio: 4.7.0.201607250649\r\n
Ti SDK: 5.5.0.v20160815115302\r\n
Appc NPM: 4.2.7\r\nAppc CLI: 5.4.0.GA\r\nXcode 7.3.1\r\nNode: v4.2.2\r\n{noformat}\r\n\r\n*Closing ticket*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-08-16T17:03:39.000+0000", "updated": "2016-08-16T17:03:39.000+0000" }, { "id": "395911", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Small issue here: The key for Calendar permissions should be {{NSCalendarsUsageDescription}} not {{NSCalendarUsageDescription}} (Calendars should be plural, not singular). So, the crash still occurs for calendars when using our advised fix. Will need a quick update on docs/release notes.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T17:36:51.000+0000", "updated": "2016-09-12T17:41:41.000+0000" }, { "id": "395914", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Fixed on master, 6_0_X and 5_5_X, please check and close. I think the release-notes are not affected, [~bimmel] please verify we have {{NSCalendarUsageDescription}} and not {{NSCalendarsUsageDescription}}.", "updateAuthor": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T17:43:37.000+0000", "updated": "2016-09-12T18:00:52.000+0000" }, { "id": "395916", "author": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hans123], confirmed. The release note is in good shape.", "updateAuthor": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T18:00:47.000+0000", "updated": "2016-09-12T18:00:47.000+0000" }, { "id": "395921", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\n\r\nMacOS 10.12 (16A239m)\r\nStudio 4.7.1.201609100950\r\nTi SDK 5.5.0.v20160912110832\r\nAppc NPM 4.2.7\r\nAppc CLI 5.5.0-6\r\nAlloy 1.9.2\r\nXcode 8.0 (8A218a)\r\n\r\nCalendar, Contacts, and Camera now properly throw an error indicating that the Keys must be added to the tiapp.xml. Once the keys are included, the app no longer crashes. Tested using the QE MediaModule as well as other test apps created that require different permissions.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T18:37:13.000+0000", "updated": "2016-09-12T18:37:13.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }