Open WilsonYHChan opened 7 years ago
@WilsonYHChan I've got the same problem using window.plugins.socialsharing.share()
method. Did you resolve this? @EddyVerbruggen, can you help us ? Please!! :sweat_smile:
No time. But PR’s are accepted as always.
Hey @WilsonYHChan @EddyVerbruggen, I found a solution for whatsapp
:
For some reason, you can't pass message. If you pass message + files parameter, whatsapp
ignores the files and share the text msg. This is strange, and I don't know why, but it works!
So, the code to share for any app, is:
window.plugins.socialsharing.share(null | "", "My subject", ["native/path/of/myfile.extension"]);
Only for whatsapp:
window.plugins.socialsharing.shareViaWhatsApp(null | "", ["native/path/of/myfile.extension"]);
is there any way to send both text and attachment same time
Hi, i am using Android phone and manage to use window.plugins.socialsharing.shareViaEmail to sent email together with the attachment as below:
window.plugins.socialsharing.shareViaEmail( 'Document sent from Testing', 'Test Subject AAA', ['abcd@gmail.com'], null, // CC: must be null or an array null, // BCC: must be null or an array ['file:///storage/MicroSD/Download/testAttach.pdf'], null, null ); *** if i remove one slash in file:///xxx become file://xxx , the attachemnt will not able to attach in the email.
my problem is when i try to use window.plugins.socialsharing.shareWithOptions as below, the attachment cannot attach into whatapps, only message appear in whatapps. i have try to set the option as
the attachment is missing but no error. if i change it to
Sharing failed with message: Attempt to invoke virtual method 'android.....' on a null object reference
Any idea what is the probelm ???
Thanks.