Open DhyanandraSingh opened 8 years ago
I want to upload selfie on facebook profile using cordova apps so i used cordovaCamera for capturing a image then use showDialog to upload this captured image on facebook. but i got an api error code 100. i.e. picture is not properly formatted.
code:
function onDeviceReady() { options = { destinationType: Camera.DestinationType.FILE_URI, sourceType: Camera.PictureSourceType.CAMERA, allowEdit: true, encodingType: Camera.EncodingType.JPEG, correctOrientation:true, quality: 80, targetWidth: 300, targetHeight: 300, correctOrientation: true }; } $scope.selfie = function() { $cordovaCamera.getPicture(options).then(function(imageURI) { alert("image location"+ imageURI); $scope.facebookImagePost(imageURI); }, function(err) { alert(" camera error"+ err); }); } $scope.facebookImagePost= function( imageURI ){ var options = { method: "feed", picture: imageURI, caption: " testing caption", description: 'testing fb post' }; alert(JSON.stringify(options.picture)); $cordovaFacebook.showDialog(options) .then(function(success) { alert( JSON.stringify(success)); }, function (error) { // error alert( JSON.stringify(error)); }); }
I want to upload selfie on facebook profile using cordova apps so i used cordovaCamera for capturing a image then use showDialog to upload this captured image on facebook. but i got an api error code 100. i.e. picture is not properly formatted.
code: