apache / apache/cordova-plugin-camera

Capture from Camera and library not working on IOS

Open
#872 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
976
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
On the latest plugin version 7.0.0, there is a problem with IOS.

### What is expected to happen?
To open the camera or library and get path of the image.

### What does actually happen?
There is no response when I call the **camera.getPicture()**.

## Information
In the cordova plugin camera 6.0.x works only using PHOTOLIBRARY but CAMERA does not. For Version 7.0.0 PHOTOLIBRARY and CAMERA no response at all.

### Command or Code
```
var get_destinationType = {
file_uri : Camera.DestinationType.FILE_URI,
data_uri : Camera.DestinationType.DATA_URL
}
var srcType = {gal : Camera.PictureSourceType.PHOTOLIBRARY, capture : Camera.PictureSourceType.CAMERA}
var options = {

quality: 100,
destinationType: get_destinationType[file_desc],
// In this app, dynamically set the picture source, Camera or photo gallery
sourceType: srcType[tp],
encodingType: Camera.EncodingType.PNG,
mediaType: Camera.MediaType.PICTURE,
correctOrientation: true
}
let cam = this;
console.log(options)
let success_img = (img)=>{
sessionStorage.setItem('uri', img);
console.log(img)


}
let error_img = (e)=>{
get_media.f7.preloader.hide();
this.f7.preloader.hide();

console.log("Error getting picture: " + e);
}
navigator.camera.getPicture(success_img, error_img, options);
}

```

### CONFIG.xml
```

Swak Merchant
Sample Apache Cordova App

Apache Cordova Team






















































need location access to find things nearby


need location access to find things nearby


need location access to find things nearby


To provide you with the best features , our app needs access to your camera, to upload product, attach photos in messaging, sending reports and changing profile picture.


To provide you with the best features, our app needs photo library access to get pictures from your device, to upload product, attach photos in messaging, sending reports and changing profile picture.


need location access to find things nearby


need photo library access to save pictures there










```

### Environment, Platform, Device
IOS

### Version information
cordova ios 7.0.1
cordova plugin 7.0.0

## Checklist

- [ ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the no-response behavior from the navigator.camera.getPicture call using Cordova iOS 7.0.1 and camera plugin 7.0.0. Inspect the iOS configuration in CONFIG.xml, especially the camera and photo-library usage descriptions. Done means both CAMERA and PHOTOLIBRARY open successfully and return an image path or invoke the error callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.