cordovaSocialSharing not calling callbacks

$cordovaSocialSharing.shareViaFacebook('Message via', res.filePath, "", 
    function() {
console.log('share ok')
},  function(err){

Sharing is successfully done to facebook but none of callback was called…

I dont know why.


changing $cordovaSocialSharing to window.plugins.socialsharing works.


you need to read the documentations correctly…

the native plugin uses callbacks to handle error and success case.
ngCordova is using promises to handle this:

.shareViaFacebook(message, image, link)
.then(function(result) {
  // Success!
}, function(err) {
  // An error occurred. Show a message to the user


I never read it but I read it from here…

I guess description is a bit different.


yeah but you used the ngCordova syntax… so maybe you mixed two things.
ngCordova is a wrapper for many recently used cordova plugins… to have a unified and simplified JavaScript API for them.


got it, keep learning, thanks!