[TIMOB-11338] iOS6 on iPad: Ti.Media.openPhotoGallery doesn't work and blocks app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2012-10-11T01:46:09.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | 2012 Sprint 21 API, 2012 Sprint 21 |
Components | iOS |
Labels | ios6, ipad, media, openPhotoGallery, to-triage |
Reporter | Fokke Zandbergen |
Assignee | Sabil Rahim |
Created | 2012-09-20T06:11:51.000+0000 |
Updated | 2013-03-27T22:55:20.000+0000 |
Description
Steps to reproduce the issue
Execute the attached app.js
Click the 'openPhotoGallery' button
Close the first alert telling 'I will now call Ti.Media.openPhotoGallery'
Notice there is no gallery opening
Try to click the 'click me later' button
Notice you cannot click it because the app (by some invisible layer?) is blocked
Attachments
File | Date | Size |
---|---|---|
app_no_alert.js | 2012-10-08T15:43:38.000+0000 | 767 |
app.js | 2012-09-20T06:11:51.000+0000 | 677 |
Pfixx.zip | 2012-09-20T23:59:58.000+0000 | 1576172 |
Screenshot 2012.09.20 12.21.30.png | 2012-09-20T12:38:20.000+0000 | 292306 |
Screenshot 2012.09.20 12.21.41.png | 2012-09-20T12:38:20.000+0000 | 349656 |
Screenshot 2012.09.20 12.21.50.png | 2012-09-20T12:38:21.000+0000 | 300038 |
Screenshot 2012.09.20 12.26.25.png | 2012-09-20T12:38:21.000+0000 | 520179 |
Testing.zip | 2012-09-20T23:59:17.000+0000 | 3121995 |
Attempted to reproduce in iPad iOS 6.0 simulator and initially got a failure in studio console:
Second attempt worked as expected. Also to note, the simulator privacy setting for photos did not contain a request from my test app for access to photos. The gallery was empty. On device, test code worked as expected for me, see screen shots. App requested access to photo gallery and when I approved, setting entry was made in privacy>photos for my test app and was set to allow access.
For comment above, I am running: Mountain Lion 10.8.1 Xcode 4.5 GM iOS 6.0 GM for iPad 3 Titanium Studio, build: 2.1.2.201208301612 SDK: 2.1.3.v20120918170114
The debug code pasted in a newly created project works indeed.. just like Eric found. But in my earlier created project, now upgraded to SDK 2.1.3 RC it does not! Compare the two newly attached ZIPs containing both projects. In the Pfixx project I stripped all other code and files so it's almost identical to the Testing project. But it just doesn't work!?!?!
Executed all 3 attached .js on: Mountain Lion 10.8.1 Xcode 4.5 GM iOS 6.0 for iPad 3 Titanium Studio, build: 2.1.2.201208301612 SDK: 2.1.3.v20120925173111 Test code worked as expected. Added photos to the simulator's gallery, so it is not empty. The simulator privacy setting for photos did not contain a request from my test app for access to photos. As a result apps do not appear in privacy settings. On device, test code worked as expected. The result is identical to Eric's.
Hi Fokke, We've been unable to reproduce this issue after trying multiple times. If you continue to experience it, or find other examples that cause it, please let us know. Best, Ingo
Hi I am still running into this issue. It all works ok as described and in the examples above (with an alert) but my issue is that i cannot have an alert box show up everytime I need the user to open the photo gallery. This could be up to 20 times within the app so i need a way of showing it without an alert box. Is there a reason or explanation in why the alert box must be present? And is there anyway of getting around it? I am running: Titanium SDK version: 2.1.3 (10/02/12 16:16 15997d0) iPhone Device family: ipad iPhone SDK version: 6.0 iPhone simulated device: ipad Minimum iOS version: 4.3 Linked iOS Version 6.0 XCode Version 4.5.1 (4G1004)
So this is the app.js (the attached app_no_alert.js) file exactly as it is in the example, with the only change (bar changing the window orientation) being the alert on the openPhotoGallery event being commented out. This makes the code no longer work
Tested with iPad Simulator iOS 6, without the alert, the app hangs and does not open the gallery. Tested with 2.1.3.GA and 3.0.0v20121009111437
Tested "app_no_alert.js" with iPad3 ios 6.0 with: Titanium Studio, build: 3.0.0.201210090117 Titanium SDK, build: 2.1.3.GA and 3.0.0v20121009111437 No alert,app hangs, same behavior, as described by Natalie
PhotoGallery(UIImagePickerController) is a portrait-only view controller and in iOS 6 Apple has started enforcing this rule. Short version being Landscape-only applications that invoke a portrait-only view controller (such as the Game Center sign-in screen or the UIImagePickerController) and are built using the iOS 6 SDK may crash/freeze up the UI. The crash log may look like "*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'" The interm solution, while Apple may fix this in the future release is to temporarily make container window in which the photogallery popover is to be attached to have a portrait orientation also included in them.
Complete code sample with for testing:
The reason why the bug does not occur when alert dialog is shown, is because of the fact that when a alert dialog is shown we no longer have the keyWindow of the Application that we control and this new window has all Orientation support on it. Marking ticket as not our bug.
See apple documentation for more info : http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html
This appears to no longer be an issue in iOS 6.1. I created a simple iPad app that only supports landscape orientation and am able to open the photo gallery without blocking.