Share document (PDF, JPG and etc) Cordova

0

Does anyone know how I can share a document using Cordova? a document that I have on my cell phone (whether temporary or not). I would like to send (other than the link) but the document itself.

    
asked by anonymous 05.05.2017 / 19:52

1 answer

0

I solved my problem using the SocialSharing plugin

var options = {
  files: ['arquivo.png'],
  chooserTitle: 'APP'
}

var onSuccess = function(result) {
  console.log("Share completed? " + result.completed); // On Android apps mostly return false even while it's true
  console.log("Shared to app: " + result.app); // On Android result.app is currently empty. On iOS it's empty when sharing is cancelled (result.completed=false)
}

var onError = function(msg) {
  console.log("Sharing failed with message: " + msg);
}

window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);
    
02.10.2017 / 15:41