{ "id": "175184", "key": "TIMOB-27984", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "21051", "description": "", "name": "Release 9.2.0", "archived": false, "released": true, "releaseDate": "2020-09-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-09-16T18:58:19.000+0000", "created": "2020-06-24T19:46:06.000+0000", "epic": { "id": 175154, "key": "TIMOB-27964", "name": "Support iOS 14", "summary": "iOS: Support iOS 14 and Xcode 12", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "photogallery" ], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-09-16T18:58:19.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": "Apple has introduced PHPicker in PhotosUI framework to handle PhotoLibrary instead of UIImagePickerViewController. UIImagePickerViewController is deprecated in iOS 14. PHPicker has new API to select multiple photos.\r\n\r\nDetails can be found https://developer.apple.com/documentation/photokit/phpickerviewcontroller\r\nhttps://developer.apple.com/documentation/photokit/phpickerconfiguration", "attachment": [], "flagged": false, "summary": "iOS 14: Use PHPicker for for accessing PhotoLibrary", "creator": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1205, "state": "closed", "name": "2020 Sprint 18", "startDate": "2020-08-31T15:45:10.220Z", "endDate": "2020-09-11T15:45:00.000Z", "completeDate": "2020-09-11T19:56:20.674Z", "originBoardId": 114 }, { "id": 1206, "state": "closed", "name": "2020 Sprint 19", "startDate": "2020-09-14T20:01:00.000Z", "endDate": "2020-09-25T20:01:00.000Z", "completeDate": "2020-09-28T15:30:19.875Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "456277", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "On comparing UIImagePickerViewController and PHPicker APIs wrt [Ti.Media.openPhotoGallary|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-method-openPhotoGallery], I found that following 2 properties are not supported in PHPicker APIs -\r\n\r\n1. [allowEditing|https://docs.appcelerator.com/platform/latest/#!/api/PhotoGalleryOptionsType-property-allowEditing]\r\n2. [allowTranscoding|https://docs.appcelerator.com/platform/latest/#!/api/PhotoGalleryOptionsType-property-allowTranscoding]\r\n\r\n'allowEditing' is important feature and I believe many developers will be using it.\r\n\r\nSo we can not replace UIImagePickerViewController completely. But Apple has deprecated it for PhotoLibrary handling, so we should also plan for same. \r\nAnd PHPicker has new API to select multiple images, which is a cool feature.\r\n\r\nSolution - \r\n If \"allowEditing\" is set to `true` or \"allowTranscoding\" is `true` while calling [Ti.Media.openPhotoGallary|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-method-openPhotoGallery], use UIImagePickerViewController (current implementation) to show Photo Library, with a deprecation warning. \r\nOtherwise use PHPickerViewController (PHPicker API) to show Photo Library. And in future major release these APIs can be removed.\r\n\r\ncc [~amukherjee] [~cwilliams] Let me know if you have any other thought.\r\nEdit - I will create a new ticket to deprecate \"allowEditing\" and \"allowTranscoding\" API which is not supported in PHPicker.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-30T01:29:12.000+0000", "updated": "2020-08-31T01:43:55.000+0000" }, { "id": "456341", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator/titanium_mobile/pull/11867\r\nTest Case - \r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow();\r\n\r\nvar navWindow = Ti.UI.createNavigationWindow({window: window});\r\nvar tableView = Ti.UI.createTableView(\r\n{\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL,\r\n});\r\nwindow.add(tableView);\r\nvar addButton = Ti.UI.createButton(\r\n{\r\n\ttitle: \"Add\",\r\n\tleft: \"10dp\",\r\n\tbottom: \"10dp\",\r\n});\r\naddButton.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\", \"Live Photo\", \"Video\", \"All\"],\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_LIVEPHOTO];\r\n\t\t} else if (e.index === 2) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_VIDEO];\r\n\t\t} else if (e.index === 3) {\r\n\t\t\tmediaTypes = [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_LIVEPHOTO, 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\tdialog.hide();\r\n\t\tTi.Media.openPhotoGallery(\r\n\t\t{\r\n\t\t\tallowMultiple: true,\r\n\t\t selectionLimit: 10,\r\n\t\t\tautohide: true,\r\n\t\t\tmediaTypes: mediaTypes,\r\n\t\t\tsuccess: function(e) {\r\n\t\t\t\tTi.API.info(\"@@@ success() e: \" + JSON.stringify(e));\r\n\t\t\t\tvar createRowFrom = function(selectionEvent) {\r\n\r\n\t\t\t\t\tvar fileName = null;\r\n\r\n\t\t\t\t\tif (!fileName) {\r\n\t\t\t\t\t\tif (selectionEvent.mediaType === Ti.Media.MEDIA_TYPE_PHOTO) {\r\n\t\t\t\t\t\t\tfileName = \"Image\";\r\n\t\t\t\t\t\t} else if (selectionEvent.mediaType === Ti.Media.MEDIA_TYPE_VIDEO) {\r\n\t\t\t\t\t\t\tfileName = \"Video\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tfileName = \"Live Photo\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar row = Ti.UI.createTableViewRow({ title: fileName });\r\n\t\t\t\t\trow.addEventListener(\"click\", function(e) {\r\n\t\t\t\t\t\tswitch (selectionEvent.mediaType) {\r\n\t\t\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_PHOTO:\r\n\t\t\t\t\t\t\t\tvar childWindow = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\t\t\t\t\t\t\t\tchildWindow.add(Ti.UI.createImageView(\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\timage: selectionEvent.media,\r\n\t\t\t\t\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\tnavWindow.openWindow(childWindow);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_LIVEPHOTO:\r\n\t\t\t\t\t\t\t\tvar childWindow = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\t\t\t\t\t\t\t\tvar livePhotoView = Ti.UI.iOS.createLivePhotoView({\r\n\t\t\t\t\t\t\t\t\tlivePhoto: selectionEvent.livePhoto,\r\n\t\t\t\t\t\t\t\t\tmuted: true,\r\n\t\t\t\t\t\t\t\t\twidth: 300\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\tlivePhotoView.addEventListener(\"start\", function(e) {\r\n\t\t\t\t\t\t\t\t\tTi.API.warn(\"-- Start playback --\");\r\n\t\t\t\t\t\t\t\t\tTi.API.warn(e);\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\tlivePhotoView.addEventListener(\"stop\", function(e) {\r\n\t\t\t\t\t\t\t\t\tTi.API.warn(\"-- Stop playback --\");\r\n\t\t\t\t\t\t\t\t\tTi.API.warn(e);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tchildWindow.add(livePhotoView);\r\n\t\t\t\t\t\t\t\tnavWindow.openWindow(childWindow);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase Ti.Media.MEDIA_TYPE_VIDEO:\r\n\t\t\t\t\t\t\t\tvar childWindow = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\t\t\t\t\t\t\t\tchildWindow.add(Ti.Media.createVideoPlayer(\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\turl: selectionEvent.media.nativePath,\r\n\t\t\t\t\t\t\t\t\tautoplay: true,\r\n\t\t\t\t\t\t\t\t\tmediaControlStyle: Ti.Media.VIDEO_CONTROL_DEFAULT,\r\n\t\t\t\t\t\t\t\t\tscalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,\r\n\t\t\t\t\t\t\t\t\twidth: Ti.UI.FILL,\r\n\t\t\t\t\t\t\t\t\theight: Ti.UI.FILL,\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\tnavWindow.openWindow(childWindow);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\talert(\"Unknown media type selected.\");\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn row;\r\n\t\t\t\t};\r\n\t\t\t\tif (e.images) {\r\n\t\t\t\t\tfor (var index = 0; index < e.images.length; index++) {\r\n\t\t\t\t\t\ttableView.appendRow(createRowFrom(e.images[index]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (e.livePhotos) {\r\n\t\t\t\t\tfor (var index = 0; index < e.livePhotos.length; index++) {\r\n\t\t\t\t\t\ttableView.appendRow(createRowFrom(e.livePhotos[index]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (e.videos) {\r\n\t\t\t\t\tfor (var index = 0; index < e.videos.length; index++) {\r\n\t\t\t\t\t\ttableView.appendRow(createRowFrom(e.videos[index]));\r\n\t\t\t\t\t}\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.add(addButton);\r\nvar clearButton = Ti.UI.createButton(\r\n{\r\n\ttitle: \"Clear\",\r\n\tright: \"10dp\",\r\n\tbottom: \"10dp\",\r\n});\r\nclearButton.addEventListener(\"click\", function(e) {\r\n\ttableView.data = [];\r\n});\r\nwindow.add(clearButton);\r\nnavWindow.open();\r\n{code}\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-05T01:47:57.000+0000", "updated": "2020-08-31T01:36:59.000+0000" }, { "id": "456848", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed\r\nOn iOS 14 - Able to select multiple photo, live photo or video or a combination of these media types upto the defined selection limit.\r\nOn iOS 13.x - The selection of single item of a media type works fine as before.", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-11T16:54:43.000+0000", "updated": "2020-09-11T16:54:43.000+0000" }, { "id": "456849", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Waiting for Jenkins build", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-11T16:55:03.000+0000", "updated": "2020-09-11T16:55:03.000+0000" }, { "id": "456916", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nMac OS: 10.15.4\r\nSDK: 9.2.0.v20200915123928, 9.3.0.v20200915132757\r\nAppc CLI: 8.1.1\r\nJDK: 11.0.4\r\nNode: 10.17.0\r\nStudio: 6.0.0.202005141803\r\nXcode: 12.0 GM\r\niPhone 7Plus(v14.0 GM), iPhone X(v13.6.1)", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-09-16T18:58:19.000+0000", "updated": "2020-09-16T18:58:19.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }