[TIMOB-17812] iOS: Feature Request to initiate the camera access prompt via Titanium Code
GitHub Issue | n/a |
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-04-30T15:12:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.0.0, Release 4.1.0 |
Components | iOS |
Labels | camera, ios8, media |
Reporter | Eduardo Gomez |
Assignee | Chee Kiat Ng |
Created | 2014-10-01T15:36:23.000+0000 |
Updated | 2015-06-29T17:44:32.000+0000 |
Description
Feature Request
When building with the 3.4.0.GA TiSDK using the iOS 8 SDK on an iPhone 6 this issue is present. The issue is not that the prompt never shows but that its only triggered by launching the camera. If I want to prompt the user before I launch the camera there is no way to prompt the user.
We would like to request the following features for Titanium 3.5.0 SDK:
1. Calling isCameraSupported() triggers the camera allowed prompt
2. If the user says Don't Allow calling isCameraSupported() again should return false, but its returning true which is incorrect.
Steps to reproduce
Build attached sample with environment specification
On the device go to settings > general > scroll to bottom, reset > reset Location & privacy
Launch the app and,
Click "is Camera supported" button
Notice that it returns 1 which is true
Click Launch Camera (Notice that a prompt is shown asking for access to the camera.
Click Dont allow
Take a picture and accept it
Notice that the picture is black
Accept the picture
Click is Camera Supported
Notice that it returns 1 which is true.
Notes
The user did not allow camera access so the isCameraSupported should return false. Also the prompt to enable camera access should be triggered by the isCameraSupported call or some other call so that we can ask the user if they want to allow camera access before we launch the camera.
Following my steps on step 4 isCameraSupported() returns a 1 that it is supported, and no prompt is shown.
Then if you go to step 6 and launch image capture the prompt shows up but at that point the camera is being launched. We need to be able to trigger the prompt on the isCameraSupported call.
Now in step 7 click the Dont Allow button and take a picture of the black area, notice its black. Now accept or close the image capture viewfinder. Click as stated in step 11 isCameraSupported(). Notice that its still a 1 which indicates that the camera is supported even though the user has not allowed access.
Attachments
Another PR option here: https://github.com/appcelerator/titanium_mobile/pull/6811 4_0_X: https://github.com/appcelerator/titanium_mobile/pull/6812
Sample Code
Verified fixed, using: MacOS 10.11 Studio 4.1.0.201506261427 Ti SDK 4.1.0.v20150626084425 Appc NPM 4.1.0-1 Appc CLI 4.1.0-4 Ti CLI 4.0.1 Alloy 1.6.2 Node v0.10.37 Java 1.7.0_45 Prompts for camera access via code is working as expected.