Navigator.camera.getPicture doesn't call success handler


#1

Hi Team,
Am stuck on this issue for the whole day. I referred some similar posts in this forum but that didn’t help me to resolve the issue.
I am using navigator.camera for taking pictrues. The success and error call back is not getting called most of the time. I have installed cordova camera plugin
I am using
ionic 1.2.8
org.apache.cordova.camera 0.3.3 “Camera”

Shown below is the code I use.

  $scope.takePicture =  function takePicture()	{
	var success = function onSuccess (FILE_URI){
		console.log("something" + FILE_URI)
		console.log(FILE_URI);
		$localstorage.setObject("file",FILE_URI);
        $rootScope.picData = FILE_URI;
	}

	var error = function onError ()	{
		console.log("Error")
		alert("error")
	}
	
            console.log("Taking picture");
	navigator.camera.getPicture(success,error,{
                quality: 50,
                destinationType: navigator.camera.DestinationType.FILE_URI,
                sourceType: navigator.camera.PictureSourceType.CAMERA
            });
};

#2

Please help. Why no replies to this post?