[TIMOB-18192] iOS: having an alert before the show camera prevents the camera from opening up
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2014-12-15T22:48:13.000+0000 |
Affected Version/s | Release 3.5.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | qe-3.5.0, regression |
Reporter | Visalakshi Chidambaram |
Assignee | Vishal Duggal |
Created | 2014-12-12T09:42:46.000+0000 |
Updated | 2017-03-22T17:55:29.000+0000 |
Description
This is a regression as it works fine on Titanium SDK 3.4.1
Having an alert message before the showCamera method does not allow the camera to open up.
Steps to reproduce:
1. Run the following:
// Containing window
var win = Ti.UI.createWindow({
//navBarHidden: true,
backgroundColor: "#ffffff",
height: Ti.UI.FILL,
width: Ti.UI.FILL
});
// Blue button that opens the camera
var open_camera = Ti.UI.createButton({
height: Ti.UI.SIZE,
width: Ti.UI.SIZE,
bottom: 50,
title: 'Camera'
});
// Adding the "open camera" button
win.add(open_camera);
// Click event to show the camera
open_camera.addEventListener("click", function(e){
alert("Testing");
Ti.Media.showCamera({});
});
// Open the window
win.open();
2. Click on the button 'camera'
Actual Results:
1. A white window with a button named 'camera' opens up
2. An alert message that says 'Testing' comes up
Expected Results:
1. A white window with a button named 'camera' opens up
2. An alert message that says 'Testing' pops up and camera also opens up.
Note: if the alert message is defined after the show camera method as follows:
// Click event to show the camera
open_camera.addEventListener("click", function(e){
Ti.Media.showCamera({});
alert("Testing");
});
then the app works fine as expected; both the camera and the alert message comes up.
I'm going to guess we need to revise test cases that involve Alert Dialogs as a result of the refactor there.
You could work around it by listening for the alert dialog dismissal and opening the camera.
This is expected behavior on iOS8 with Alerts. We do not allow AlertDialog to present any ViewController. The only exception is the error controller which is only ever displayed in development mode and not in production applications. Going to resolve this as Won't Fix
Closing ticket as the issue will not fix and with reference to the above comments.