{ "id": "164959", "key": "TIMOB-24205", "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": "18154", "name": "Release 6.0.1", "archived": false, "released": true, "releaseDate": "2016-12-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-12-19T13:19:38.000+0000", "created": "2016-12-09T19:49:18.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios", "media", "regression" ], "versions": [ { "id": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-12-19T13:19:42.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": "The Ti.Media.CAMERA_AUTHORIZATION_* constants are no longer defined. They all return {{undefined}}. Code like the following worked in our app up till 5.5.x. Updating to 6.0.0.GA it fails to recognize that the user has already granted permission.\r\n\r\n{code:javascript}\r\nswitch (Ti.Media.cameraAuthorization) {\r\n case Ti.Media.CAMERA_AUTHORIZATION_AUTHORIZED:\r\n // camera permissions granted, do something like\r\n Ti.Media.showCamera();\r\n break;\r\n case Ti.Media.CAMERA_AUTHORIZATION_DENIED:\r\n case Ti.Media.CAMERA_AUTHORIZATION_RESTRICTED:\r\n // they have denied access to the camera\r\n alert('You denied camera permission. Use Settings to grant them');\r\n break;\r\n default:\r\n \t// they'll be prompted for perms...\r\n}\r\n\r\nconsole.log(Ti.Media.cameraAuthorization); // => 3\r\nconsole.log(Ti.Media.CAMERA_AUTHORIZATION_AUTHORIZED); // => undefined\r\nconsole.log(Ti.Media.CAMERA_AUTHORIZATION_DENIED); // => undefined\r\n{code}\r\n\r\nTIMOB-17812 shows a similar way to use these constants. Our app has been using them since iOS8 was first released. They are still documented in the Ti.Media pages. I see nothing in the 6.x release notes about them being removed.\r\n\r\nThe following code works, but is not equivalent. For example, it won't let me differentiate between a user who has not yet granted permissions and one who has explicitly denied permissions. That means I can't show them a custom app dialog to tell them what great features they're missing by having denied permissions.\r\n\r\n{code}\r\nif (OS_IOS) {\r\n if (Ti.Media.hasCameraPermissions()) {\r\n // yay!\r\n } else {\r\n // boo hoo\r\n }\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.Media.CAMERA_AUTHORIZATION_* permissions are `undefined` in some 6.0.0.GA cases", "creator": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 770, "state": "closed", "name": "2016 Sprint 25 SDK", "startDate": "2016-12-03T01:53:07.491Z", "endDate": "2016-12-17T01:53:00.000Z", "completeDate": "2016-12-21T03:19:43.884Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "403113", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "My quote from Slack:\r\n{quote}\r\nCamera constants are only compiled for device builds when you use the camera API's. The background is the pre-6.0.0 issue where Apple rejected apps because of camera API's although you didn't use them. In 6.0.0, we checked those more smart so the symbols are only generated when you use the related camera api's. Currently, it gets generated when you use {{Ti.Media.hasCameraPermissions()}} or {{Ti.Media.hasAudioPermissions()}}, so it should probably be improved.\r\n{quote}\r\nThe fix is quite easy, i would add the {{TI_MEDIACAMERAAUTHORIZATION}} for the valid symbol that trigger the API compilation. \r\n\r\nAre there other (independent) API's / use.cases where you would use the constants in combination with? Thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-09T23:32:21.000+0000", "updated": "2016-12-09T23:32:21.000+0000" }, { "id": "403115", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/8674\r\nPR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8675", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-09T23:42:31.000+0000", "updated": "2016-12-10T10:46:07.000+0000" }, { "id": "403125", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Thanks for the fast response Hans. Obviously, I haven't tested your solution but the explanation makes sense and your PR looks like it should resolve the issue. It looks like you've made the change for just camera but not audio related constants. Should you do both?", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-10T21:20:37.000+0000", "updated": "2016-12-10T21:20:37.000+0000" }, { "id": "403126", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Which ones do you mean again? {{AUDIO_SESSION_PORT_\\*}}, {{AUDIO_SESSION_OVERRIDE_ROUTE_\\*}} and {{AUDIO_SESSION_CATEGORY_\\*}} are available when you use one of this API's:\r\n- Ti.Media.AudioPlayer\r\n- Ti.Media.MusicPlayer\r\n- Ti.Media.VideoPlayer\r\n- Ti.Media.Sound\r\n- Ti.Media.AudioRecorder", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-10T21:33:41.000+0000", "updated": "2016-12-10T21:34:01.000+0000" }, { "id": "403169", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Sorry, I was comparing your statement above that both audio and camera properties would be defined if you used related APIs with the fact that your PR made changes to camera properties only. Therefore, I was assuming that maybe similar changes would have been needed for audio properties. I see that's not the case. So, disregard my audio-related comment.", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-12T14:13:43.000+0000", "updated": "2016-12-12T14:13:43.000+0000" }, { "id": "403457", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "NPM Version: 2.15.9\r\nNode Version: 4.5.0\r\nMac OS: 10.12.1\r\nAppc CLI: 6.1.0\r\nAppc CLI NPM: 4.2.8\r\nTitanium SDK version: 6.0.1.v20161215113432\r\nAppcelerator Studio, build: 4.8.1.201612050850\r\nXcode 8.1 and 8.2\r\niOS Devices: 9.3 and 10.1.1\r\n\r\nValidated fix with the above environment. I installed an app with the code above, and found that \"defined\" is not returned to console.\r\n", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-15T21:26:45.000+0000", "updated": "2016-12-15T21:26:45.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }