Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用cordova在Whatsapp/Facebook/Instagram和任何其他社交媒体上共享图像?_Javascript_Jquery_Cordova - Fatal编程技术网

Javascript 如何使用cordova在Whatsapp/Facebook/Instagram和任何其他社交媒体上共享图像?

Javascript 如何使用cordova在Whatsapp/Facebook/Instagram和任何其他社交媒体上共享图像?,javascript,jquery,cordova,Javascript,Jquery,Cordova,我正在cordova上开发一个应用程序,我想添加一个功能,使用户能够在电子邮件、whatsapp、facebook、twitter、instagram等各种媒体上共享图像。有人知道有没有简单的方法吗?你可以试试社交共享phonegap插件 一些例子: <button onclick="window.plugins.socialsharing.share(null, null, 'https://www.google.nl/images/srpr/logo4w.png', null)">

我正在cordova上开发一个应用程序,我想添加一个功能,使用户能够在电子邮件、whatsapp、facebook、twitter、instagram等各种媒体上共享图像。有人知道有没有简单的方法吗?

你可以试试社交共享phonegap插件

一些例子:

<button onclick="window.plugins.socialsharing.share(null, null, 'https://www.google.nl/images/srpr/logo4w.png', null)">image only</button>
// Beware: passing a base64 file as 'data:' is not supported on Android 2.x: https://code.google.com/p/android/issues/detail?id=7901#c43
// Hint: when sharing a base64 encoded file on Android you can set the filename by passing it as the subject (second param)
<button onclick="window.plugins.socialsharing.share(null, 'Android filename', 'data:image/png;base64,R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmNlnibXdVqolmhcRQA7', null)">base64 image only</button>
// Hint: you can share multiple files by using an array as thirds param: ['file 1','file 2', ..], but beware of this Android Kitkat Facebook issue: [#164]
<button onclick="window.plugins.socialsharing.share('Message and image', null, 'https://www.google.nl/images/srpr/logo4w.png', null)">message and image</button>
<button onclick="window.plugins.socialsharing.share('Message, image and link', null, 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, image and link</button>
<button onclick="window.plugins.socialsharing.share('Message, subject, image and link', 'The subject', 'https://www.google.nl/images/srpr/logo4w.png', 'http://www.x-services.nl')">message, subject, image and link</button>