I’ve tried many different methods, but I still haven’t been able to solve the problem. I’m trying to send a video via WhatsApp, but nothing happens. Did I do something wrong?
Example code:
function shareVideoToWhatsApp(videoPath) {
var contentUri = app.Path2Uri(videoPath);
alert("URI: " + contentUri);
var extras = [
{ name: "android.intent.extra.STREAM", type: "uri", value: contentUri }
];
app.SendIntent(
"com.whatsapp",
null,
"android.intent.action.SEND",
null,
null,
"video/mp4",
extras,
"Result",
function(resultCode, data) {
alert("Result: " + resultCode);
}
);
}
shareVideoToWhatsApp("a.mp4");