EddyVerbruggen / SocialSharing-PhoneGap-Plugin

👨‍❤️‍💋‍👨 Cordova plugin to share text, a file (image/PDF/..), or a URL (or all three) via the native sharing widget
MIT License
1.77k stars 910 forks source link

'shareWithOptions' fail to share pdf file #773

Open WilsonYHChan opened 7 years ago

WilsonYHChan commented 7 years ago

i am using cordova to build hybrid apps. currently i need to share the pdf file to social apps and i am using cordova-plugin-x-socialsharing for sharing. i found out the attachment file only work for shareviaEmail. The 'shareWithOptions' and 'share' manage to share the 'text' to gmail together with the subject and message, but fail to attach file in gmail. If i am using 'shareViaEmail', everything work fine. Since i am not sure user will use what widget ( whatapps, wechat ... ) to share the pdf, so i can't use shareViaEmail.

*** confirm the pdf file exists because i manage to attach it to the gmail and sent.

wilywork commented 7 years ago

hi, i have the same problems, but is only shareWithOptions, my share action normal. my share code.. window.plugins.socialsharing.share( message, title, "data:application/pdf;base64, sdfde........." ); in SocialSharing.java line 429 have is.. sendIntent.setType(image.substring(image.indexOf("data:") + 5, image.indexOf(";base64")));

"image.indexOf("data:") + 5" ??