2017-03-18 13:48:23 +01:00
function shareMeNow ( message , subject , url ) {
// this is the complete list of currently supported params you can pass to the plugin (all optional)
var options = {
2017-04-09 03:35:31 +02:00
message : message ? entityToHtml ( message ) : '' , // not supported on some apps (Facebook, Instagram)
subject : subject ? entityToHtml ( subject ) : 'Share this:' , // fi. for email
2017-03-25 16:32:18 +01:00
//files: ['', ''], // an array of filenames either locally or remotely
2017-03-25 18:37:25 +01:00
url : url || 'https://www.ecn.org/xm24' ,
2017-03-25 16:32:18 +01:00
} ;
2017-03-18 13:48:23 +01:00
var onSuccess = function ( result ) {
2017-03-25 16:32:18 +01:00
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)
} ;
2017-03-18 13:48:23 +01:00
var onError = function ( msg ) {
2017-03-25 16:32:18 +01:00
console . log ( "Sharing failed with message: " + msg ) ;
} ;
2017-03-18 13:48:23 +01:00
window . plugins . socialsharing . shareWithOptions ( options , onSuccess , onError ) ;
2017-03-18 12:43:16 +01:00
}