Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18192] iOS: having an alert before the show camera prevents the camera from opening up

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2014-12-15T22:48:13.000+0000
Affected Version/sRelease 3.5.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-3.5.0, regression
ReporterVisalakshi Chidambaram
AssigneeVishal Duggal
Created2014-12-12T09:42:46.000+0000
Updated2017-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.

Comments

  1. Ingo Muschenetz 2014-12-12

    I'm going to guess we need to revise test cases that involve Alert Dialogs as a result of the refactor there.
  2. Ingo Muschenetz 2014-12-15

    You could work around it by listening for the alert dialog dismissal and opening the camera.
  3. Vishal Duggal 2014-12-15

    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
  4. Lee Morris 2017-03-22

    Closing ticket as the issue will not fix and with reference to the above comments.

JSON Source