cordovaSocialSharing not calling callbacks


#1
$cordovaSocialSharing.shareViaFacebook('Message via http://talkipia.com', res.filePath, "http://talkipia.com", 
    function() {
console.log('share ok')
},  function(err){
        console.log(err);
});

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

I dont know why.


#2

changing $cordovaSocialSharing to window.plugins.socialsharing works.


#3

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:

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

#4

oh…
I never read it but I read it from here…

I guess description is a bit different.


#5

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.


#6

got it, keep learning, thanks!