Hoping to get a little help on this as I’ve been struggling with this for a while. I’m using ngCordova and it seems like it can access the photo library on the ios simulator just fine, but I can’t on an actual device (iPhone 5s with ios8). I’m uploading my app using the Ionic View app for device testing. Here’s my controller code to access the photo library:
.controller('CustomerFormController', function ($scope, $cordovaCamera) {
$scope.getPicture = function() {
var options = {
quality: 75,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions
};
$cordovaCamera.getPicture(options).then(function (imageData) {
$scope.imgURI = imageData;
}, function (err) {
console.log("err accessing photo library", err)
});
}
}
My guess is that my config.xml is incorrect but not sure where.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.moss" version="0.0.1" xmlns:gap="http://phonegap.com/ns/1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>moss-ionic</name>
<description>
An Ionic Framework and Cordova project.
</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">
Ionic Framework Team
</author>
<content src="index.html"/>
<access origin="*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="BackupWebStorage" value="none"/>
<gap:plugin name="org.apache.cordova.camera"/>
<gap:plugin name="org.apache.cordova.media-capture"/>
<feature name="http://api.phonegap.com/1.0/camera"/>
<feature name="Camera">
<param name="ios-package" value="CDVCamera"/>
<param name="android-package" value="org.apache.cordova.camera.CameraLauncher"/>
</feature>
<feature name="Contacts">
<param name="ios-package" value="CDVContacts"/>
</feature>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage"/>
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser"/>
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
</feature>
</widget>