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.78k stars 907 forks source link

Open in iBooks missing on options when I share a pdf #410

Open vdias38 opened 8 years ago

vdias38 commented 8 years ago

Hi,

I'm sharing a local pdf using the following call: window.plugins.socialsharing.share(null, null, fileEntry.nativeURL)

Where fileEntry.nativeURL = file:///var/mobile/Containers/Data/Application/40DEAE99-6D19-4505-B403-573029CFC829/Library/NoCloud/337d7eeae6dd818a1d5d7909cd363c83.pdf

On ActionSheet only Mail and Slack options are available, "Open in iBooks" is missing

The path of file is good because I can share it by mail. To guarantee files permissions are correctly setted I've tried using fileopener2 plugin in place of SocialSharing and the option "Open in iBooks" appears and works cordova.plugins.fileOpener2.open(fileEntry.nativeURL, 'application/pdf', success, error)

Should I set something else to allow "Open in iBooks" from SocialSharing ?

Thanks for your help

vdias38 commented 8 years ago

re-Hi,

please any help about this issue ?

EddyVerbruggen commented 8 years ago

Will take a look!

EddyVerbruggen commented 8 years ago

Hi, fileopener2 uses the UIDocumentInteractionController, this plugin uses SLComposeViewController. The latter filters out any app that can't receive an image when a file is passed in. So these are really two different beasts.

vdias38 commented 8 years ago

Thanks Eddy for your reply, that means SocialSharing plugin shouldn't suggest to open on iBooks ? I've seen mentioned on an old issue #307 that appears on options "open in ibooks", it's why I've tried to find out how to reach it. And using shareVia it couldn't work ? I've also tested without success.

EddyVerbruggen commented 8 years ago

Ah I see, perhaps that changed in iOS internally then.. I see there's something new in iOS called UIActivityTypeOpenInIBooks so perhaps we will see the revival of iBooks one day. Leaving this open..