I’m trying to use some of the constants in the Camera object. I am able to use the Camera object (call getPicture()) to take and save pictures but the options have no affect and when I use Camera.EncodingType or any of the keys in Camera, they are all undefined. I threw a log in the Camera.js file below where it populates the cameraExport object with the keys and the cameraExport has all of them intact.
I’ve tried to remove the plugin and re-add it. I’ve tried to remove the platform and re-add it. Neither of these worked.
Any ideas? The comments provide a little more detail. And if you need me to provide anything else, please let me know.
.controller('PictureCtrl', function($scope, $state, $ionicPlatform, Camera) {
$scope.photo1Uri = 'http://sci8.com/wp-content/uploads/2014/10/test-all-the-things.jpg';
$ionicPlatform.ready(function() {
// Checking camera object... It shows '{ }', like the object is empty.
// When I try to do an alert on Camera.EncodingType or something else, it's undefined and will error if I try to reference the values in Camera.EncodingType.
alert(JSON.stringify(Camera));
});
$scope.getPhoto = function(photoId) {
// This all works fine, except it only saves in the application directory - not the gallery.
Camera.getPicture().then(function(photoUri) {
$scope.photo1Uri = photoUri;
}, function(err) {
console.err(err);
},
{
// All these config values do nothing
// If I try to use "encodingType: Camera.EncodingType.JPEG," - the camera won't launch.
correctOrientation: true,
saveToPhotoAlbum: true
});
};
}
Thanks in advance!