{ "id": "163363", "key": "TIMOB-23936", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-01-10T17:49:01.000+0000", "created": "2016-09-21T19:09:24.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-01-11T00:28:54.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.Issue Description\r\nTi SDK 5.5.0 and iOS 10 introduce new behaviors and expose a bug in Titanium using Ti.Media.showCamera() with an overlay\r\n\r\nUsing SDK 5.2.2, and setting allowEditing=false. Yet, users could still pinch to zoom and tap within the photo to set the exposure point. With iOS 10, app built with 5.2.2 and allowEditing set to false, pinch & exposure no longer work.\r\n\r\nMigrating to 5.5.x / Xcode 8 and testing the code with that environment with allowEditing=false, pinch & exposure don't work. (NSCameraUsageDescription key is added in tiapp.xml.)\r\n\r\nSetting allowEditing=true, users can again pinch to zoom and set exposure, however, they can no longer tap on the buttons in the overlay. It's as if the camera preview is at a higher zIndex .. the overlay is visible however touch events go to the camera not the overlay.\r\n\r\nAs a result, users are stuck -- they can't tap on the overlay's Done button to close the camera and use the rest of the app. They have to force-quit the app. \r\n\r\nh6. Steps to reproduce\r\n\r\n# Donwload Test app at https://www.dropbox.com/s/ufsealzqfqdpytj/app.zip?dl=0\r\n\r\n# Create a default Alloy project. \r\n# Make sure to add the NSCameraUsageDescription to the tiapp.xml. \r\n# Replace the app folder with the one linked above. \r\n# Build to an iOS 10 device. \r\n# Tap open camera. \r\n# You can pinch to zoom and tap to set exposure, but the shutter button and Done buttons don't respond to taps. \r\n# Edit the app/controllers/index.js to set allowEditing=false, rebuild. \r\n# This time, you cannot pinch to zoom but you can tap the shutter or done buttons. \r\n\r\n* Adjusting the zIndex on the overlay view has no effect.\r\n", "attachment": [ { "id": "60309", "filename": "screenshot-1.png", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-09-22T16:43:00.000+0000", "size": 13668, "mimeType": "image/png" }, { "id": "60632", "filename": "TestProvisioning.zip", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-01T09:20:47.000+0000", "size": 64923, "mimeType": "application/zip" }, { "id": "61229", "filename": "TestProvisioning-failing.zip", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-10T17:48:48.000+0000", "size": 123016, "mimeType": "application/zip" } ], "flagged": false, "summary": " Ti.Media.showCamera() with overlay bug on iOS 10", "creator": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 5.5.0.GA\r\nXcode 8 ", "closedSprints": [ { "id": 741, "state": "closed", "name": "2016 Sprint 22 SDK", "startDate": "2016-10-22T00:02:29.945Z", "endDate": "2016-11-05T00:02:00.000Z", "completeDate": "2016-11-07T04:38:58.335Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "396922", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Test-case (based on the Alloy-project):\r\n{code:javascript}\r\n// -- General UI -- //\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: \"Open Camera\",\r\n top: 50\r\n});\r\n\r\nvar pic = Ti.UI.createImageView({\r\n width: 300,\r\n bottom: 30,\r\n backgroundColor: \"#ccc\"\r\n});\r\n\r\n// -- Overlay UI -- //\r\n\r\nvar overlay = Ti.UI.createView();\r\nvar takePictureButton = Ti.UI.createButton({\r\n bottom: 50,\r\n right: 30,\r\n title: \"Take Picture!\",\r\n backgroundColor: \"#ff0\",\r\n width: 150,\r\n height: 40\r\n});\r\nvar hideCameraButton = Ti.UI.createButton({\r\n bottom: 50,\r\n left: 30,\r\n title: \"Close Camera!\",\r\n backgroundColor: \"#00f\",\r\n width: 150,\r\n height: 40\r\n});\r\n\r\ntakePictureButton.addEventListener(\"click\", function() {\r\n Ti.Media.takePicture();\r\n});\r\n\r\nhideCameraButton.addEventListener(\"click\", function() {\r\n Ti.Media.hideCamera();\r\n});\r\n\r\noverlay.add(takePictureButton);\r\noverlay.add(hideCameraButton);\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n Ti.Media.showCamera({\r\n overlay: overlay,\r\n showControls: false,\r\n autohide: false,\r\n transform: Ti.UI.create2DMatrix().scale(1), // forces the camera to not be zoomed in\r\n success: function(e) {\r\n pic.image = e.media;\r\n Ti.Media.hideCamera();\r\n },\r\n cancel: function(e) {\r\n Ti.API.warn(\"Cancelled: \" + JSON.stringify(e));\r\n },\r\n error: function(e) {\r\n Ti.API.error(\"Error: \" + JSON.stringify(e));\r\n },\r\n saveToPhotoGallery: false,\r\n allowEditing: true, // set to false and it works but you can't zoom or set exposure\r\n mediaTypes: Ti.Media.MEDIA_TYPE_PHOTO\r\n });\r\n});\r\n\r\nwin.add(btn);\r\nwin.add(pic);\r\nwin.open();\r\n{code}\r\n\r\nThis is what we have in our core:\r\n{code:objc}\r\nif (editable) {\r\n // turn off touch enablement if image editing is enabled since it will\r\n // interfere with editing\r\n [view performSelector:@selector(setTouchEnabled_:) withObject:NUMBOOL(NO)];\r\n}\r\n{code}\r\nMeans, as soon as we have the {{allowEditing}} set to {{true}}, it will manually disable the view interaction because of the above reason. Maybe the interference changed for iOS 10, so we could wrap it accordingly. Testing ...\r\n\r\n*EDIT*: Yeah, removing that snippet solves the issue. I'm pretty sure it was an old hack (implemented: 2010, SDK 1.8.0) to fix some native misbehavior. To ensure, I need this tested against an iOS 9 and iOS 8 device. [~eharris] / [~htbryant] can I send one of you guys a packaged SDK to test?\r\n\r\n*Summary*: I guess Apple has made the pinch-zoom and exposure as part of {{allowEditing}} on iOS 10. So the customer could enable it as proposed and we fix the line above to either be removed completely or only be called on iOS < 10. That's what I need feedback from the QE regarding the current behavior of iOS < 10 will the above test-case compared to iOS 10. After that, I can setup a proper PR. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-22T09:48:53.000+0000", "updated": "2016-09-22T10:27:17.000+0000" }, { "id": "396954", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Testing on both iOS10 / iOS9 devices, I created a matrix to display the behaviour for the different configurations, please see below:\r\n\r\n!screenshot-1.png!\r\n\r\nTested On:\r\n\r\niPhone 6 Plus 10.0.1 Device\r\niPhone 5S 9.3.5 Device\r\nMac OSX El Capitan 10.11.6\r\nTi SDK: 5.5.0.GA / 5.5.1.v20160921190109\r\nAppc Studio: 4.8.0.201609101003\r\nAppc NPM: 4.2.8-6\t\r\nApp CLI: 5.5.0\r\nXcode 8.0 \r\nNode v4.4.7\r\n", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-09-22T16:44:14.000+0000", "updated": "2016-09-22T16:44:14.000+0000" }, { "id": "397076", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the report Harry. I am wondering one thing: The reporter says that the pinch-zoom and exposure does not work on iOS 10 when {{allowEditing}} is set to {{false}}. But in your tests, it seems to work. Can you verify that? I am curious if we should really remove the above snippet, because if we don't use custom-controls ({{showControls}} set to {{true}}), {{allowEditing}} will display a native UI to crop the image. Not sure if that will interfere again or if the developer would be able to configure the behavior so it doesn't happen. Many property-dependencies here, so we need to be cautious.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-23T19:07:42.000+0000", "updated": "2016-09-23T19:07:42.000+0000" }, { "id": "398112", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "[~hansknoechel] I can verify that the results displayed in the above matrix are accurate, I had considered the original behaviour described, and tested it multiple times to make sure.", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-10-05T12:10:35.000+0000", "updated": "2016-10-05T12:10:35.000+0000" }, { "id": "399760", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ok. I will check.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-25T03:25:43.000+0000", "updated": "2016-10-25T03:25:43.000+0000" }, { "id": "400018", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "# I think there is confusion in understanding property, allowEditing . As per our doc\r\n {code:yml}\r\n name: allowEditing\r\n summary: Specifies if the media should be editable after capture/selection.\r\n type: Boolean\r\n platforms: [iphone, ipad]\r\n default: false\r\n {code}\r\n# This don't have to do anything with enabling/disabling of Pinch Zoom or Tap Exposure.\r\n# This (allowEditing) is only used after capturing image not in open camera state.\r\n# We can fix Pinch Zoom and Tap Exposure behaviour by removing the below code snippet -\r\n{code:objc}\r\n if (editable)\r\n {\r\n // turn off touch enablement if image editing is enabled since it will\r\n // interfere with editing\r\n [view performSelector:@selector(setTouchEnabled_:) withObject:NUMBOOL(NO)];\r\n }\r\n{code}\r\n5. After above changes (point 4) matrix will changed as -\r\nios9/ios10 , allowEditing = true/false : \r\nPinch Zoom, Tap Exposure, Take Picture and Close Camera will work .\r\n\r\nPlease let me know your comments.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-28T08:08:11.000+0000", "updated": "2016-10-28T12:17:51.000+0000" }, { "id": "400028", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~vijaysingh] Did you check my above comment regarding the removal of this line?\r\n\r\n{quote}\r\nI am curious if we should really remove the above snippet, because if we don't use custom-controls (showControls set to true), allowEditing will display a native UI to crop the image. Not sure if that will interfere again or if the developer would be able to configure the behavior so it doesn't happen. Many property-dependencies here, so we need to be cautious.\r\n{quote}\r\n\r\nPlease test my use-case that also has the {{showControls}} property enabled. It caused problems for that use-case if we remove the line.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-28T12:16:33.000+0000", "updated": "2016-10-28T12:16:42.000+0000" }, { "id": "400154", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I created a sample iOS camera app and compared its behavior with Titanium SDK camera app by changing the value of properties (showControls, isEditing and customControls) . Results are as below -\r\n\r\n========== Native Camera App ============\r\n\r\n1. showControls = true and isEditing = True , custom overlay = true\r\n { a. Capture image with native control - Will open a native UI to crop image.\r\n b.Capture image with custom control - Same \r\n }\r\n2. showControls = true and isEditing = false , custom overlay = true\r\n { a. Capture image with native control - Will open a native UI to confirm image (With “Use photo” an d “Retake” button).\r\n b.Capture image with custom control - Same \r\n }\r\n3. showControls = false and isEditing = true , custom overlay = true\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Capture image directly. \r\n }\r\n\r\n4. showControls = false and isEditing = false , custom overlay = true\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Capture image directly. \r\n }\r\n\r\n5. showControls = true and isEditing = True , custom overlay = false\r\n { a. Capture image with native control - Will open a native UI to crop image.\r\n b.Capture image with custom control - Invalid \r\n }\r\n\r\n6. showControls = true and isEditing = false , custom overlay = false\r\n { a. Capture image with native control - Will open a native UI to confirm image (With “Use photo” an d “Retake” button).\r\n b.Capture image with custom control - Invalid \r\n }\r\n\r\n7. showControls = false and isEditing = true , custom overlay = false\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Invalid. \r\n }\r\n\r\n8. showControls = false and isEditing = false , custom overlay = false\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Invalid. \r\n }\r\n\r\n\r\n========== Titanium SDK camera app (by commenting line [view performSelector:@selector(setTouchEnabled_: ) withObject:NUMBOOL(NO)]; ) ============\r\n\r\n\r\n1. showControls = true and isEditing = True , custom overlay = true\r\n { a. Capture image with native control - Will open a native UI to crop image.\r\n b.Capture image with custom control - Same \r\n }\r\n\r\n2. showControls = true and isEditing = false , custom overlay = true\r\n { a. Capture image with native control - Will open a native UI to confirm image (With “Use photo” an d “Retake” button).\r\n b.Capture image with custom control - Same \r\n }\r\n\r\n3. showControls = false and isEditing = true , custom overlay = true\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Capture image directly. \r\n }\r\n\r\n\r\n4. showControls = false and isEditing = false , custom overlay = true\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Capture image directly. \r\n }\r\n\r\n\r\n5. showControls = true and isEditing = True , custom overlay = false\r\n { a. Capture image with native control - Will open a native UI to crop image.\r\n b.Capture image with custom control - Invalid \r\n }\r\n\r\n\r\n6. showControls = true and isEditing = false , custom overlay = false\r\n { a. Capture image with native control - Will open a native UI to confirm image (With “Use photo” an d “Retake” button).\r\n b.Capture image with custom control - Invalid \r\n }\r\n\r\n\r\n7. showControls = false and isEditing = true , custom overlay = false\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Invalid. \r\n }\r\n\r\n8. showControls = false and isEditing = false , custom overlay = false\r\n { a. Capture image with native control - Invalid\r\n b.Capture image with custom control - Invalid. \r\n }\r\n\r\n As per comparison , both (native and sdk) have similar behaviour .\r\n\r\nBut there is one code snippet -\r\n\r\n [TiUtils setView:view positionRect:[picker view].bounds];\r\n which create overlay above whole camera screen, whatever be the size of overlay . So in case of image captured as per 1,2, 5 and 6 , “Use photo” and “Retake” button are not working as it comes below overlay view .\r\n\r\n Ideally above line snippet should be like -\r\n [TiUtils setView:view positionRect:view.bounds];\r\n\r\n \r\n*+ Result -+* For getting similar behavior as of native , we should change following -\r\n1. Comment code snippet -\r\n view performSelector:@selector(setTouchEnabled_: ) withObject:NUMBOOL(NO)];\r\n \r\n2. Change code snippet -\r\n [TiUtils setView:view positionRect:[picker view].bounds];\r\n to \r\n [TiUtils setView:view positionRect:view.bounds];\r\n\r\n[~hansknoechel] [~cng] Let me know your comment on same.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-01T09:11:20.000+0000", "updated": "2016-11-01T09:12:50.000+0000" }, { "id": "400156", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Native camera app attached as TestProvisioning.zip . ", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-01T09:22:27.000+0000", "updated": "2016-11-01T09:22:27.000+0000" }, { "id": "400168", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR(master): https://github.com/appcelerator/titanium_mobile/pull/8571\r\n\r\nUnnecessary check for disabling touch of overlay view removed . \r\nBound of overlay view was getting set wrong . It was getting set to bound of picker view, so overlay view covered whole screen . Bound of overlay view set properly .", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-01T15:03:19.000+0000", "updated": "2016-11-01T15:04:03.000+0000" }, { "id": "400347", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~vijaysingh] master-PR merged, please do a 6_0_X backport, we will include it in 6.0.0.GA :-)", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-03T16:33:12.000+0000", "updated": "2016-11-03T16:33:12.000+0000" }, { "id": "400377", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] PR for 6_0_X : https://github.com/appcelerator/titanium_mobile/pull/8583", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-04T04:23:07.000+0000", "updated": "2016-11-04T04:23:07.000+0000" }, { "id": "400668", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Tested again on iOS10 & iOS9 devices with the latest 6.0.X branch and can confirm that the {{allowEditing}} property now defines whether or not an image can be edited AFTER capture, and that in both cases of this property being true / false, Pinch to Zoom, Tap Exposure work correctly. \r\n\r\nOne thing to note is that the custom controls on the overlay are no longer able to displayed. This is using the following demo code that was provided previously:\r\n\r\n{code:java}\r\n// -- General UI -- //\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\n \r\nvar btn = Ti.UI.createButton({\r\n title: \"Open Camera\",\r\n top: 50\r\n});\r\n \r\nvar pic = Ti.UI.createImageView({\r\n width: 300,\r\n bottom: 30,\r\n backgroundColor: \"#ccc\"\r\n});\r\n \r\n// -- Overlay UI -- //\r\n \r\nvar overlay = Ti.UI.createView();\r\nvar takePictureButton = Ti.UI.createButton({\r\n bottom: 10,\r\n right: 30,\r\n title: \"Take Picture!\",\r\n backgroundColor: \"#ff0\",\r\n width: 150,\r\n height: 40\r\n});\r\nvar hideCameraButton = Ti.UI.createButton({\r\n bottom: 10,\r\n left: 30,\r\n title: \"Close Camera!\",\r\n backgroundColor: \"#00f\",\r\n width: 150,\r\n height: 40\r\n});\r\n \r\ntakePictureButton.addEventListener(\"click\", function() {\r\n Ti.Media.takePicture();\r\n});\r\n \r\nhideCameraButton.addEventListener(\"click\", function() {\r\n Ti.Media.hideCamera();\r\n});\r\n \r\noverlay.add(takePictureButton);\r\noverlay.add(hideCameraButton);\r\n \r\nbtn.addEventListener(\"click\", function() {\r\n Ti.Media.showCamera({\r\n overlay: overlay,\r\n showControls: false,\r\n autohide: false,\r\n transform: Ti.UI.create2DMatrix().scale(1), // forces the camera to not be zoomed in\r\n success: function(e) {\r\n pic.image = e.media;\r\n Ti.Media.hideCamera();\r\n },\r\n cancel: function(e) {\r\n Ti.API.warn(\"Cancelled: \" + JSON.stringify(e));\r\n },\r\n error: function(e) {\r\n Ti.API.error(\"Error: \" + JSON.stringify(e));\r\n },\r\n saveToPhotoGallery: false,\r\n allowEditing: true, // set to false and it works but you can't zoom or set exposure\r\n mediaTypes: Ti.Media.MEDIA_TYPE_PHOTO\r\n });\r\n});\r\n \r\nwin.add(btn);\r\nwin.add(pic);\r\nwin.open();\r\n{code}\r\n\r\n*When building the app with SDK 5.5.1.GA the custom controls are present.*\r\nHowever, setting the {{showControls}} property to TRUE exposes the native controls, which work without issue.\r\nBefore I can validate this ticket as closed, I need clarification for the custom controls no longer being visible. Is this an *intended* change or a *bug*?\r\n\r\nTested On:\r\niPhone 6 Plus 10.1.1 Device \r\niPhone 5S 9.3.5 Device\r\nMac OS Sierra (10.12.1)\r\nTi SDK: 6.0.0.v20161107075927\r\nAppc Studio: 4.8.0.201611020954\r\nAppc NPM: 4.2.8-9\r\nApp CLI: 6.0.0-68\r\nXcode 8.1\r\nNode v4.4.7\r\n\r\n", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-11-09T20:03:36.000+0000", "updated": "2016-11-09T20:04:25.000+0000" }, { "id": "400673", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "As I was the original reporter via a support ticket, we would not consider this resolved if we could not use our own custom control to take the photo. This would be a change in behavior from the old SDK versions and would not fit with our UI.", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-11-09T22:01:20.000+0000", "updated": "2016-11-09T22:01:20.000+0000" }, { "id": "400694", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "If we create overlay in following way, it will be visible -\r\nvar overlay = Ti.UI.createView({\r\n top: 10,\r\n left: 10,\r\n width: 300,\r\n height: 60\r\n});\r\n\r\nrather \r\nvar overlay = Ti.UI.createView();\r\n\r\nI will discuss with [~hansknoechel] and [~cng] for better solution, which work in scenario as mentioned in comment as well .\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-10T08:23:33.000+0000", "updated": "2016-11-10T08:23:48.000+0000" }, { "id": "400730", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "I can confirm that as per [~vijaysingh]'s comment, when specifying values for the {{width}} & {{height}} properties for the Overlay view, the custom controls become visible. After further investigation it was found that in fact the overlay view will only be visible in this case, and that not specifying a numerical value for either {{width}} or {{height}} will prevent the view from being visible, along with the custom controls within it. \r\n\r\nThis is specific to the case when a view is used as an overlay view for Ti.Media.showCamera(options), there are no issues when a created View is added as a child of a standard Window. It also only occurs with the 6.0.X build. The usual case is that when {{height}} and {{width}} are not specified, the default value will be {{Ti.UI.SIZE}}, which seems to be the case for 5.5.1.GA. \r\n\r\nAdditionally when I replaced the numerical values of the {{height}} and {{width}} properties to it's default equivalent: {{Ti.UI.FILL}} / {{Ti.UI.SIZE}} , the overlay was not visible when built with 6.0.X \r\n\r\n", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-11-10T18:28:33.000+0000", "updated": "2016-11-10T18:29:52.000+0000" }, { "id": "400732", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We won't keep it like it is. Views should fill (Ti.UI.FILL) for both {{height}} and {{width}} when they are not specified. So either we come up with a more solid solution to get the correct frame or we need to move this to 6.0.1 - reverting the initial commit. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-10T18:33:20.000+0000", "updated": "2016-11-10T18:33:20.000+0000" }, { "id": "400775", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel]\r\nPR(master): https://github.com/appcelerator/titanium_mobile/pull/8596\r\nPR(6_0_X): https://github.com/appcelerator/titanium_mobile/pull/8597", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-11T10:15:45.000+0000", "updated": "2016-11-11T10:15:45.000+0000" }, { "id": "400784", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The issue is fixed with the recent PR we've been working on. It fixes the default layout specs and uses auto-filling as supposed to be. It was just merged, so [~skypanther], if you want, you can check it out and contact me on Slack to talk about your findings. Thx! :-)", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-11T13:56:27.000+0000", "updated": "2016-11-11T13:56:27.000+0000" }, { "id": "400788", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Thank you all. Unfortunately, it will be a couple of weeks till I can actually try this. Our app uses quite a few modules which are not compatible with 6.x. I started working on updating them, but have been sidetracked by other priorities. On the good-news side, this ticket was one of the key things we were looking forward to in the 6.x line. So, this gives us incentive to push forward.", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-11-11T14:18:42.000+0000", "updated": "2016-11-11T14:18:42.000+0000" }, { "id": "400791", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Gotcha, thanks anyway!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-11T14:21:57.000+0000", "updated": "2016-11-11T14:21:57.000+0000" }, { "id": "403107", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "I finally got a chance to test this in our app. It is not working. I have set {{allowEditing}} to {{true}} and I cannot pinch to zoom or set the exposure point. I also tried setting {{showControls}} to {{true}} and while I briefly see a yellow square in the preview area (a crop window I guess), I still cannot pinch to zoom or set the exposure point.\r\n\r\n{code}\r\nif (OS_IOS) {\r\n Ti.Media.showCamera({\r\n overlay: overlay.getView(),\r\n showControls: false,\r\n autohide: false,\r\n transform: Ti.UI.create2DMatrix().scale(1), // forces the camera to not be zoomed in\r\n success: function (event) {\r\n console.log('Ti.Media.showCamera success callback');\r\n },\r\n cancel: function () {\r\n destroyOverlay();\r\n },\r\n error: function () {\r\n destroyOverlay();\r\n },\r\n saveToPhotoGallery: false,\r\n allowEditing: true,\r\n mediaTypes: Ti.Media.MEDIA_TYPE_PHOTO\r\n });\r\n} else ...\r\n{code}\r\n\r\n* Appc cli version 6.0.0\r\n* SDK version 6.0.0.GA\r\n* iPhone 5 running iOS 10.1.1 (14B100)\r\n\r\n{code}\r\n>> appc setup\r\nFinding latest version ...6.0.0 ✓\r\nVersion 6.0.0 already installed.\r\n? Do you plan on developing Titanium apps? Yes\r\n\r\nChecking your environment...\r\n\r\nYou have the latest Titanium SDK release 6.0.0.GA\r\nCongrats! No issues detected for developing cross-platform mobile apps!\r\n\r\nappc setup complete!\r\n{code}", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-09T20:25:23.000+0000", "updated": "2016-12-09T20:25:23.000+0000" }, { "id": "403108", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "As a follow-up, I will say that my \"take-picture\" button and other controls on the overlay are now clickable with allowEditing set to true. So, we have made progress but it's not all the way there yet. Was this maybe not released in 6.0.0.GA as the release notes say? Is it still to come in 6.0.1?", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-09T20:27:43.000+0000", "updated": "2016-12-09T20:27:43.000+0000" }, { "id": "403213", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Some further test results:\r\n\r\n* iPhone 7 running iOS 10.1.1. No pinch to zoom or exposure point.\r\n* iPhone 5 running iOS 10.1.1. No pinch to zoom or exposure point. \r\n* iPod Touch running iOS 9.3.5. Both pinch to zoom and setting exposure point work.", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-12T21:20:04.000+0000", "updated": "2016-12-12T21:20:04.000+0000" }, { "id": "403249", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ssekhri] Can you please verify the scenario and let me know the result.\r\n\r\nAs per my observation in native camera app “TestProvisioning.zip” and camera app using titanium sdk -\r\n- in iOS 9 and iOS 10 tap to exposure property is only available with showControls = true (in this yellow lined square will visible )\r\n- in iOS 9 if showControls = false (yellow lined square will not be visible but when we tap on camera and move finger exposure will change)\r\n- in iOS 10 if showControls = false, tap to exposure property is not working .\r\n- two finger zoom feature is available in both iOS 10 and iOS 9 both .\r\n\r\nNote - If we do not give width and height property to overlay view, it will be of screen size.\r\n\r\nPlease compare behavior with attached native iOS camera app “TestProvisioning.zip”, by changing the property.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-13T09:15:56.000+0000", "updated": "2016-12-13T09:15:56.000+0000" }, { "id": "403302", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Apparently I deleted the previous zip file from my Dropbox folder. Here it is again https://www.dropbox.com/s/o5nrno8oep8ydea/TIMOB-23936.zip?dl=0 \r\n\r\n(BTW, you could solve the problem of links going stale if you let people attach files to tickets.)", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-13T20:49:55.000+0000", "updated": "2016-12-13T20:49:55.000+0000" }, { "id": "403355", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When using the classic app code as provided in the very first comment by Hans, the pinch to zoom works fine irrespective of the size of overlay view (default, custom or Ti.UI.Fill for both height and width). The pinch to zoom works on both iOS 9 and iOS 10 device.\r\n\r\nHowever when using the alloy app provided by Tim Poulsen, the issue as reported by Tim for pinch to zoom does exist. The zoom works on iOS 9 but not on iOS 10. In the app the overlay controller defines the overlay view of height and width to be Ti.UI.Fill. However if the same overlay view from the controller was changed to be of lesser height like 100 then camera view shown beyond worked fine for zoom on iOS 10 as well. Also if a simple view was created in the index.js and passed to the overlay instead of the view from controller, the zoom works on iOS 10.\r\n\r\nAs far as Tap to Exposure property is concerned it behaves the same in Titanium app as it behaves in a native iOS app. The Tap to exposure works on iOS 10 only when showControls = True in both Titanium and native swift app.\r\n ", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-14T09:11:13.000+0000", "updated": "2016-12-14T09:20:56.000+0000" }, { "id": "403379", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Our app's UI spec calls for the overlay to fill the screen. I have tried setting an explicit height/width of various sizes, but at no size could I get the pinch-to-zoom to work. I tried setting in the TSS as well as in the overlay controller (JS) file. I tried setting to a simple integer, to Ti.Platform.displayCaps.platformWidth / Height, and to a constant defined in the alloy.js all with the same result -- no zoom/exposure controls. I tried with both our actual app and with the linked sample project with the same results. ", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-14T16:08:29.000+0000", "updated": "2016-12-14T16:08:29.000+0000" }, { "id": "403480", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] As result shared by Satyam and Tim Paulson are contradictory, Can you please have a fresh pair of eyes on the issue.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-16T06:37:53.000+0000", "updated": "2016-12-16T06:37:53.000+0000" }, { "id": "403592", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I got back to this issue and validated that the same behavior is on both the native project and our Titanium app. That's why we will resolve this issue first (since it's a 6.0.0 ticket and 6.0.0 is released already) and keep an eye on Tim's response after getting in touch with Apple about a possible regression from their side (like TIMOB-23910 and TIMOB-24137). Thanks guys!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-19T08:05:31.000+0000", "updated": "2016-12-19T08:05:31.000+0000" }, { "id": "403616", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "So, in summary, this is resolved as \"Not our bug\" and you won't be doing anything further on it, correct? Functionality that worked pre-5.5 is no longer supported? You should at least update your docs and include info in your release notes to set developer expectations that this sort of functionality is no longer possible with Titanium.", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2016-12-19T15:57:58.000+0000", "updated": "2016-12-19T15:57:58.000+0000" }, { "id": "404353", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "I had some time to check this again today.\r\n\r\nEnvironment: Xcode 8.2.1, Titanium SDK 6.0.1.GA, CLI 6.1.0.GA, on an iPhone 5 with iOS 10.2\r\n\r\nI do NOT get pinch to zoom OR exposure control using any combination of the following:\r\n\r\n* {{allowEditing: true}} or {{false}}\r\n* {{showControls: true}} or {{false}}\r\n* width/height of the overlay set in the TSS to {{Ti.UI.FILL}} or set to explicit heights using values calculated at app start time from {{Ti.Platform.displayCaps.platform*}} or simple point values such as {{340}}/{{500}}\r\n* width/height of the overlay set in the controller that creates the overlay controller prior to calling {{showCamera}} to {{Ti.UI.FILL}}, {{Alloy.Globals.deviceHeight}}/{{Width}} (calculated at app start time from {{Ti.Platform.displayCaps.platform*}}, or {{340}}/{{500}}\r\n* adding/removing the {{transform}} property to the {{showCamera}} call\r\n\r\nI'm still confused how Apple's bug about the transform relates to this ticket and gives you reason to close it (as FIXED). While I'd prefer to not see the camera controls box, frankly if it has to be there in order to get pinch to zoom and exposure control working, I can live with it. Again, Apple having a bug that makes it impossible to hide that box is not justification for closing this ticket as FIXED.\r\n\r\nThe only thing fixed here is that UI elements in my overlay are now tappable. ", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2017-01-10T15:49:56.000+0000", "updated": "2017-01-10T15:49:56.000+0000" }, { "id": "404357", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~acvauctions]\r\nHi Tim. I spoke with Hans about this one, but would like to understand it for myself. I'll take a look today.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-10T16:13:07.000+0000", "updated": "2017-01-10T16:13:07.000+0000" }, { "id": "404362", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey Tim, I thought this was clear after my last comment, sorry if not. The summary (as stated above) is that Apple changed the behavior in iOS (or caused an iOS bug - like the transform one). We attached a native project during the discussion last months, did multiple native device tests and it's all behaving the same. The fix we applied fixed the tap-gestures as stated by you, that's why this ticket has been marked as {{Fixed}}. If there would be a fix on the native side, we would apply it, but so far there isn't. Please let me know if I should record another video demonstrating the native behavior, but no code-adjustment could change that.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-10T16:33:57.000+0000", "updated": "2017-01-10T16:33:57.000+0000" }, { "id": "404363", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Addition: To clear all points - it worked pre-5.5.0 because pre-5.5.0 was not built with the iOS 10 SDK (iOS 10 on the device != iOS 10 SDK).", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-10T16:38:16.000+0000", "updated": "2017-01-10T16:38:16.000+0000" }, { "id": "404368", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Here are the findings [~skypanther] and me found out after some more investigations:\r\n* The issue was / is not the overlay itself, it is the layout of those views\r\n* When we have two views that overlaying each other (e.g. two filling views in this case), iOS will not be able to receive any gestures anymore\r\n* This worked in iOS 9 (Ti SDK < 5.5.0) and stopped working in iOS 10 (Ti SDK >= 5.5.0)\r\n* Both the native app and the Ti app behave the same when we check against that specific use-case (that was the problem before)\r\n* I updated the native project to reflect the native issue\r\n* I created a bugreport at Apple (29949293) and create an open radar ([#http://www.openradar.me/radar?id=6104055453581312|http://www.openradar.me/radar?id=6104055453581312])for this issue\r\n* In the specific use-case for Tim, removing the container view for the flash resolved the issue temporary - although it's not the ideal solution\r\n* I will update our docs to inform devs about this special behavior\r\n* I will keep this ticket updated based on Apples response", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-10T17:36:10.000+0000", "updated": "2017-01-10T17:36:10.000+0000" }, { "id": "404369", "author": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "body": "Thanks to [~ hansknoechel] for working through this with me in TiSlack. He deserves a raise, by the way.\r\n\r\nIn our testing, we have found that due to a change in iOS 10, you cannot have multiple views overlaid atop the camera window. For example, using my sample app posted on 13/Dec/16, by removing both the {{wrapper}} and {{flashOverlay}} views from the overlay the pinch to zoom and exposure controls work on an iOS 10 device. An iOS 9.3.5 device works fine with those Views present or removed.\r\n\r\nSetting the additional views to {{opacity: 0}} or {{backgroundColor: 'transparent'}} does not resolve the issue. It appears to be something related to events on child views not bubbling to the parents properly. \r\n\r\nThis means that I will have to rework our UI layout. But, at least the problem is now solvable. Thanks Hans!!", "updateAuthor": { "name": "acvauctions", "key": "acvauctions", "displayName": "Tim Poulsen (ACV)", "active": true, "timeZone": "America/New_York" }, "created": "2017-01-10T17:38:45.000+0000", "updated": "2017-01-10T17:38:45.000+0000" }, { "id": "404414", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "OK [~acvauctions], I'll see what I can do for Hans. :)", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-11T00:28:54.000+0000", "updated": "2017-01-11T00:28:54.000+0000" } ], "maxResults": 45, "total": 45, "startAt": 0 } } }