Share document (PDF, JPG, etc.)

Asked

Viewed 170 times

1

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

1 answer

0


I solved my problem using the plugin Socialsharing

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);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.