{ "id": "163895", "key": "TIMOB-24018", "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-07T05:36:01.000+0000", "created": "2016-10-12T03:08:33.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-6.0.1" ], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" }, { "id": "18322", "name": "Release 5.5.1", "archived": false, "released": true, "releaseDate": "2016-09-28" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2016-12-19T19:32:15.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": "h5.Reproduce\r\n1. Create a new default mobile app and add following code to app.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"white\"\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: \"Test\",\r\n\ttop: 100,\r\n});\r\n\r\nbutton.addEventListener(\"click\", function(){\r\n\tif (Ti.Media.hasAudioPermissions()) {\r\n\t\talert('-> THIS APP HAS AUDIO PERMISSIONS');\r\n\t} else {\r\n\t\talert('-> THIS APP HAS NO AUDIO PERMISSIONS');\r\n\t};\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}\r\n2. Run the app on iOS 10 device\r\n3. Click the \"Test\" button\r\n\r\nh5.Expect Result\r\nIt should alert whether the app have Audio permission\r\n\r\nh5.Actual Result\r\nApp crashed and exit. ", "attachment": [], "flagged": false, "summary": "iOS: Calling Titanium.Media.hasAudioPermissions() is crashing the app", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "iOS 10 \r\niPhone 6plus\r\nSDK 5.5.0.GA and 5.5.1.GA", "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 }, { "id": 733, "state": "closed", "name": "2016 Sprint 21 SDK", "startDate": "2016-10-08T00:53:00.000Z", "endDate": "2016-10-22T00:53:00.000Z", "completeDate": "2016-10-24T03:58:08.547Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "398648", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Sorry just realised this is audio permissions. will investigate.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-12T03:14:57.000+0000", "updated": "2016-10-12T03:20:53.000+0000" }, { "id": "398666", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The {{Ti.Media.hasAudioPermissions()}} method is only available in Titanium SDK 6.0.0 and later (see [the docs|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-method-hasAudioPermissions]). 6.0.0 will be released in mid November, thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-12T10:23:38.000+0000", "updated": "2016-10-12T10:23:38.000+0000" }, { "id": "402664", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/8664\r\nPR (6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8665\r\n\r\nTest-Case:\r\n(Please set the {{NSMicrophoneUsageDescription}} key in the plist section of your tiapp.xml first)\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n title: 'Test audio permissions',\r\n top: 100,\r\n});\r\n\r\nbutton.addEventListener('click', function() {\r\n if (Ti.Media.hasAudioPermissions()) {\r\n alert('-> THIS APP HAS AUDIO PERMISSIONS');\r\n } else {\r\n Ti.API.warn('-> THIS APP HAS NO AUDIO PERMISSIONS, TRYING TO REQUEST ...');\r\n Ti.Media.requestAudioPermissions(function(e) {\r\n if (!e.success) {\r\n Ti.API.error('Requesting audio permissions failed!');\r\n return;\r\n }\r\n\r\n alert('Audio permissions granted!');\r\n })\r\n };\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-06T17:34:50.000+0000", "updated": "2016-12-06T17:34:50.000+0000" }, { "id": "402852", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "CR and FT Passed! APPROVED!", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-12-07T05:35:45.000+0000", "updated": "2016-12-07T05:35:45.000+0000" }, { "id": "403409", "author": { "name": "sulaimaanrawoot", "key": "sulaimaanrawoot", "displayName": "sulaimaanrawoot", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, I have just tested this on a iphone 5s ios 9 and an iphone 6 ios 10 and it does not work.\r\nThe app crashes and shuts down.", "updateAuthor": { "name": "sulaimaanrawoot", "key": "sulaimaanrawoot", "displayName": "sulaimaanrawoot", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-15T07:11:38.000+0000", "updated": "2016-12-15T07:11:38.000+0000" }, { "id": "403411", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~sulaimaanrawoot] did you do this\r\n(Please set the {{NSMicrophoneUsageDescription}} key in the plist section of your tiapp.xml first and read [this post|http://www.appcelerator.com/blog/2016/09/ga-release-for-titanium-sdk-5-5-0-appcelerator-cli-5-5-0-appcelerator-studio-4-7-1/] about privacy settings introduced by iOS 10).\r\n", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-15T07:57:14.000+0000", "updated": "2016-12-15T09:08:31.000+0000" }, { "id": "403419", "author": { "name": "sulaimaanrawoot", "key": "sulaimaanrawoot", "displayName": "sulaimaanrawoot", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi, yes I did.\r\n\r\nThis is my plist section.\r\n\r\n\r\n \r\n UISupportedInterfaceOrientations~iphone\r\n \r\n UIInterfaceOrientationPortrait\r\n \r\n UISupportedInterfaceOrientations~ipad\r\n \r\n UIInterfaceOrientationPortrait\r\n UIInterfaceOrientationPortraitUpsideDown\r\n UIInterfaceOrientationLandscapeLeft\r\n UIInterfaceOrientationLandscapeRight\r\n \r\n UIRequiresPersistentWiFi\r\n \r\n UIPrerenderedIcon\r\n \r\n UIStatusBarHidden\r\n \r\n UIStatusBarStyle\r\n UIStatusBarStyleDefault\r\n NSMicrophoneUsageDescription\r\n Can we use your microphone?\r\n \r\n \r\n\r\nAnd this is the code:\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle : 'Test audio permissions',\r\n\ttop : 100,\r\n});\r\n\r\nbutton.addEventListener('click', function() {\r\n\tif (Ti.Media.hasAudioPermissions()) {\r\n\t\talert('-> THIS APP HAS AUDIO PERMISSIONS');\r\n\t} else {\r\n\t\tTi.API.warn('-> THIS APP HAS NO AUDIO PERMISSIONS, TRYING TO REQUEST ...');\r\n\t\tTi.Media.requestAudioPermissions(function(e) {\r\n\t\t\tif (!e.success) {\r\n\t\t\t\tTi.API.error('Requesting audio permissions failed!');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\talert('Audio permissions granted!');\r\n\t\t});\r\n\t};\r\n});\r\n\r\nwin.add(button);\r\nwin.open();\r\n\r\nI can't see where I am going wrong. No error is logged the app just crashes. I am using sdk 6, testing on an iphone 5s running IOS 9 and I am using the latest xcode, 8.2 i think.", "updateAuthor": { "name": "sulaimaanrawoot", "key": "sulaimaanrawoot", "displayName": "sulaimaanrawoot", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-15T12:10:50.000+0000", "updated": "2016-12-15T12:10:50.000+0000" }, { "id": "403448", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "[~sulaimaanrawoot] What SDK are you using?, I have just tested on {{6.0.1.v20161214184817}} with Xcode 8.2 and the test case worked fine.", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-12-15T19:27:23.000+0000", "updated": "2016-12-15T19:27:23.000+0000" }, { "id": "403632", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified fixed, using: \r\n\r\n{noformat}\r\nmacOS Sierra 10.12.1\r\niPhone 6 (10.2)\r\niPhone 5 (9.3.5)\r\niOS simulator (10.2)\r\nTi SDK 6.0.1.v20161217061750\r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0\r\nXcode 8.2\r\n{noformat}\r\n\r\n{{Ti.Media.hasAudioPermissions()}} no longer crashes the app.\r\n\r\n*Closing ticket*\r\n\r\n\r\n", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-12-19T19:31:55.000+0000", "updated": "2016-12-19T19:31:55.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }