{ "id": "170519", "key": "TIMOB-25579", "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": [], "resolution": null, "resolutiondate": null, "created": "2017-12-01T23:30:55.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "engSchedule", "qe-7.0.0" ], "versions": [ { "id": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" }, { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-04-23T15:32:28.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Description*\r\nOn an iOS 10 device (and simulator), the photo gallery cannot be opened after an alert is displayed. This issue is not seen for iOS 11. The issue is also not seen on Android.\r\n\r\n*Steps to reproduce*\r\n1. Create a new app in Studio and use the test case provided in the description below. Update tiapp.xml to allow Photo Library usage.\r\n2. Run the app on either the simulator or device. The iOS version should be iOS 10.\r\n3. Press the \"Photo\" button in the app when the alert dialog pops up.\r\n\r\n*Actual results*\r\nThe Alert Dialog will disappear , however the photo library does not get accessed. A blank screen is shown.\r\n\r\n*Expected results*\r\nAfter the alert dialog disappears, the photo library should be opened. For reference, run the same app on iOS 11, or on Android. The photo library is correctly opened in those cases.\r\n\r\n{code}\r\nvar window = Ti.UI.createWindow();\r\nwindow.addEventListener(\"open\", function(e) {\r\n\tvar dialog = Ti.UI.createAlertDialog(\r\n\t{\r\n\t\tmessage: \"Which media type do you want to open?\",\r\n\t\tbuttonNames: [\"Photo\", \"Video\", \"Both\"],\r\n\t});\r\n\tdialog.addEventListener(\"click\", function(e) {\r\n\t\tvar mediaTypes;\r\n\t\tif (e.index === 0) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_PHOTO];\r\n\t\t} else if (e.index === 1) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_VIDEO];\r\n\t\t} else if (e.index === 2) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_VIDEO];\r\n\t\t} else {\r\n\t\t\tTi.API.info(\"@@@ Alert was canceled.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tTi.Media.openPhotoGallery(\r\n\t\t{\r\n\t\t\tallowMultiple: false,\r\n\t\t\tallowEditing: false,\r\n\t\t\tautohide: true,\r\n\t\t\tmediaTypes: mediaTypes,\r\n\t\t\tsuccess: function(e) {\r\n\t\t\t\tswitch (e.mediaType) {\r\n\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_PHOTO:\r\n\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_LIVEPHOTO:\r\n\t\t\t\t\t\twindow.add(Ti.UI.createImageView(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\timage: e.media,\r\n\t\t\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_VIDEO:\r\n\t\t\t\t\t\twindow.add(Ti.Media.createVideoPlayer(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\turl: e.media.nativePath,\r\n\t\t\t\t\t\t\tautoplay: true,\r\n\t\t\t\t\t\t\tmediaControlStyle: Ti.Media.VIDEO_CONTROL_DEFAULT,\r\n\t\t\t\t\t\t\tscalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,\r\n\t\t\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcancel: function() {\r\n\t\t\t\tTi.API.info(\"@@@ Photo gallery selection canceled.\");\r\n\t\t\t},\r\n\t\t\terror: function() {\r\n\t\t\t\tTi.API.info(\"@@@ Photo gallery selection error.\");\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\tdialog.show();\r\n});\r\nwindow.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Cannot open photo gallery after displaying alert on iOS 10", "creator": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Node Version: 8.9.1\r\nNPM Version: 5.5.1\r\nMac OS: 10.13.1\r\nAppc CLI: 7.0.0-master.55\r\nAppc CLI NPM: 4.2.11-4\r\nTitanium SDK version: 7.0.0.v20171130091945\r\niOS SDK 10.3.3 \r\nDevice: iPhone 6 Plus", "comment": { "comments": [ { "id": "433649", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I verified it using Xcode, it is working fine.\r\nIn studio with Kroll_thread it is working fine, but on main_thread with iOS 10.x this issue is happening.\r\nEven if we execute the code inside eventListener for 'click' event, it is working fine for studio as well.\r\nThe problem is happening if this code is executing for 'open' event. Following test case will work fine for Studio as well -\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\nwindow.addEventListener(\"click\", function(e) {\r\n\tvar dialog = Ti.UI.createAlertDialog(\r\n\t{\r\n\t\tmessage: \"Which media type do you want to open?\",\r\n\t\tbuttonNames: [\"Photo\", \"Video\", \"Both\"],\r\n\t});\r\n\tdialog.addEventListener(\"click\", function(e) {\r\n\t\tvar mediaTypes;\r\n\t\tif (e.index === 0) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_PHOTO];\r\n\t\t} else if (e.index === 1) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_VIDEO];\r\n\t\t} else if (e.index === 2) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_VIDEO];\r\n\t\t} else {\r\n\t\t\tTi.API.info(\"@@@ Alert was canceled.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tTi.Media.openPhotoGallery(\r\n\t\t{\r\n\t\t\tallowMultiple: false,\r\n\t\t\tallowEditing: false,\r\n\t\t\tautohide: true,\r\n\t\t\tmediaTypes: mediaTypes,\r\n\t\t\tsuccess: function(e) {\r\n\t\t\t\tswitch (e.mediaType) {\r\n\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_PHOTO:\r\n\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_LIVEPHOTO:\r\n\t\t\t\t\t\twindow.add(Ti.UI.createImageView(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\timage: e.media,\r\n\t\t\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_VIDEO:\r\n\t\t\t\t\t\twindow.add(Ti.Media.createVideoPlayer(\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\turl: e.media.nativePath,\r\n\t\t\t\t\t\t\tautoplay: true,\r\n\t\t\t\t\t\t\tmediaControlStyle: Ti.Media.VIDEO_CONTROL_DEFAULT,\r\n\t\t\t\t\t\t\tscalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,\r\n\t\t\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t\t\t}));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tcancel: function() {\r\n\t\t\t\tTi.API.info(\"@@@ Photo gallery selection canceled.\");\r\n\t\t\t},\r\n\t\t\terror: function() {\r\n\t\t\t\tTi.API.info(\"@@@ Photo gallery selection error.\");\r\n\t\t\t},\r\n\t\t});\r\n\t});\r\n\tdialog.show();\r\n});\r\nwindow.open();\r\n{code}\r\n\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-25T06:57:35.000+0000", "updated": "2018-01-25T10:57:24.000+0000" }, { "id": "433794", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Simple test case to reproduce the issue -\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\n\r\nwindow.addEventListener(\"open\", function(e) {\r\n\tvar dialog = Ti.UI.createAlertDialog(\r\n\t{\r\n\t\tmessage: \"Which media type do you want to open?\",\r\n\t\tbuttonNames: [\"Photo\", \"Video\", \"Both\"],\r\n\t});\r\n\tdialog.addEventListener(\"click\", function(e) {\r\n\t Ti.API.info(\"@@@ Index is\" +e.index);\r\n\t});\r\n\tdialog.show();\r\n});\r\nwindow.open();\r\n{code}\r\n\r\nClick event of dialog is not fired in iOS 10.x with main_thread in CLI/Studio. But if I run the same test case using Xcode, it is fired. [~fmiao] Can you please look in this, if anything can be done from your side. Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-29T10:22:20.000+0000", "updated": "2018-01-29T10:22:20.000+0000" }, { "id": "433808", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "This doesn't look like a CLI/Studio issue. [~hknoechel], need your expert opinion on this. :)", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2018-01-30T00:51:39.000+0000", "updated": "2018-01-30T00:51:39.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }