最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to show my cordova app in IOS share menu? - Stack Overflow

programmeradmin0浏览0评论

We have an existing Cordova iOS App for which we need an iOS share extension which will allow Users to to share files from other apps (like Photos, Pages, Numbers, Keynote, etc) with our App (i.e. Export file from Pages to our App).

We need the following delivered:

  • Prototype / Sample iOS Cordova App
  • with a share extension setup up for jpg, png, video, pdf and office (xls, xlsx, doc, docx, ppt, pptx) files
  • Extension to either open the Cordova App directly OR to open the Cordova App as a webview inside the share widget
  • Cordova App must receive parameters about the shared file (filename, path, type, filesize) from extension - the handling of the file afterwards will be done by us.
  • Documentation on how to implement this functionality (share extension) in our existing Cordova App (steps necessary to perform in Xcode etc)

We have an existing Cordova iOS App for which we need an iOS share extension which will allow Users to to share files from other apps (like Photos, Pages, Numbers, Keynote, etc) with our App (i.e. Export file from Pages to our App).

We need the following delivered:

  • Prototype / Sample iOS Cordova App
  • with a share extension setup up for jpg, png, video, pdf and office (xls, xlsx, doc, docx, ppt, pptx) files
  • Extension to either open the Cordova App directly OR to open the Cordova App as a webview inside the share widget
  • Cordova App must receive parameters about the shared file (filename, path, type, filesize) from extension - the handling of the file afterwards will be done by us.
  • Documentation on how to implement this functionality (share extension) in our existing Cordova App (steps necessary to perform in Xcode etc)
Share Improve this question asked Jun 30, 2017 at 9:59 Harish MahajanHarish Mahajan 3,2944 gold badges29 silver badges49 bronze badges 5
  • Possible duplicate of How to add PhoneGap apps at Androids sharing interface – user5734311 Commented Jun 30, 2017 at 10:06
  • @ChrisG:- i already done in android. but i have difficulty in iOS. – Harish Mahajan Commented Jun 30, 2017 at 10:20
  • Right, sorry, I read "cordova" and somehow jumped to "Android" right away. – user5734311 Commented Jun 30, 2017 at 11:34
  • Hi @harish, you can refer this blog post and update your ments over there. divami./blog/… – Sivakumar Commented Jul 12, 2017 at 12:14
  • I @harishmahajan, have you found any response to achieved share extension for image ? – Djiggy Commented Sep 14, 2017 at 15:27
Add a ment  | 

4 Answers 4

Reset to default 3

There is a cross-platform cordova plugin (iOS and Android) that achieves that: https://github./j3k0/cordova-plugin-openwith

I think you could find a solution here. It is not clear, but it seems to work.

That's a good and still relevant question.

I tried to make use of the awesome cordova-plugin-openwith by Jean-Christophe Hoelt but faced several issues. The plugin is meant to receive share items of one type (say, URL, text or image), which is configured during installation. Also, with its current implementation, writing a note to share and selecting a receiver in a Cordova app are two different steps in different (native and Cordova) context, so it didn't look as a good user experience to me.

I made these and other corrections to this plugin and published it as a separate plugin: https://github./EternallLight/cordova-plugin-openwith-ios

Note that it works only for iOS, not for Android.

There are few links which could be helpful even if you do not want to use open with plugin

https://irace.me/tumblr-ios-extension

http://engineering.curalate./2017/03/09/ios-share-ext-with-ionic.html

In android editing, the manifest worked fine for me. I had to add one more java file added in some already added plugin like below in plugin.xml. Which in turn added in the manifest.

            <intent-filter>
                <action android:name="android.intent.action.SEND" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="image/*" />
                <data android:mimeType="application/pdf"/>
                <data android:mimeType="application/msword"/>
                <data android:mimeType="application/mspowerpoint"/>
                <data android:mimeType="application/powerpoint"/>
                <data android:mimeType="application/vnd.ms-powerpoint"/>
                <data android:mimeType="application/x-mspowerpoint"/>
                <data android:mimeType="application/excel"/>
                <data android:mimeType="application/vnd.ms-excel"/>
                <data android:mimeType="application/x-excel"/>
                <data android:mimeType="application/x-msexcel"/>
                <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document"/>
                <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
                <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation"/>
            </intent-filter>
        </activity>
发布评论

评论列表(0)

  1. 暂无评论