cordova-plugin-openwith: Is Image Sharing Required by this plugin? Can't get it work sharing text only....
Great plugin! Thank you so much for putting it together!
Question: I have an app that I would like to receive shares of text from other apps, but can’t accept image sharing. Is that possible? When I try what looks like the obvious, it doesn’t seem to work…e.g.:
If I install the plugin via:
cordova plugin add cc.fovea.cordova.openwith --variable ANDROID_MIME_TYPE="image/*" --variable IOS_URL_SCHEME=ccfoveaopenwithdemo --variable IOS_UNIFORM_TYPE_IDENTIFIER=public.image
it works as expected - the photos app can share images to my app. But text selected in an app cannot.
However, if I install via:
cordova plugin add cc.fovea.cordova.openwith --variable ANDROID_MIME_TYPE="text/*" --variable IOS_URL_SCHEME=ccfoveaopenwithdemo --variable IOS_UNIFORM_TYPE_IDENTIFIER=public.text
Then neither sharing an image nor text to my app seems possible (my app doesn’t show in the share menu).
Is it possible to only share text? I have not yet tried the “extra actions” approach but would prefer not to have my app show on the image sharing menu since I can’t accept it…
Thanks!
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 15 (2 by maintainers)
@ankitjainOfficial I have text sharing working. I use the openwith-ios plugin for iOS mentioned by @tverilytt (https://github.com/EternallLight/cordova-plugin-openwith-ios) and https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent for Android. I don’t do any image sharing. My use case is sharing text selected in the Kindle app to my app, but one can also share URLs from browsers and such.
It’s been awhile since I set this up so my detailed memory is hazy but if you have specific questions would be happy to dig into it again. But the combination of these two plugins can get you there.
@viking2917 @tverilytt I have successfully integrated the Android side, with the intent plugin. Thanks for the iOS part. Thanks guys.
It could be handy to support multiple mime types, e.g. both images and text. In my case, I am thinking of support for text (URLs) in addition to images. Use case being sharing image URL from e.g. Web browser or other apps.
Cheers -jo
Hi, the MIME TYPE and UTI defines which of kind of things the plugin can open.
text/*
should allow you to share a text file, if you have a app that handles text files which have a “Open With…” option, your app should be listed…My only use case was image (I think every users so far as well), so I never really explored this.
It’s not impossible that the plugin needs minor adjustment to make this work, let me know if learn anything.