如何在所有合格并显示iOS应用程序中共享PDF文件? [英] How to Share PDF file in all eligable and appear iOS app?

查看:261
本文介绍了如何在所有合格并显示iOS应用程序中共享PDF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UIActivityViewController来共享PDF文件,我已经成功应用了所有代码来共享.Pdf文件,并且当我看到那里的共享表选项时,我可以共享或发送我的PDF文件,例如Facebook,Gmail,打印,复印等等,但是在我的iPhone中,还有一些应用程序,我们可以在其中共享PDF文件,例如微信,在iBooks中打开,在Hike中打开,在chrome中打开等,但是这些选项未显示在我的共享列表中,如这张图片.

但是当我使用UIDocumentInteractionController时,我看到了所有共享选项Facebook,Gmail,微信,在iBooks中打开,在远足中打开等.当我使用UIDocumentInteractionController时,所有支持pdf的应用程序都显示为共享选项,如下所示图片.

但是我想使用UIActivityViewController,并想查看所有支持PDF文件的选项,例如Wechat,在iBooks中打开,在远足中打开.喜欢这张图片....

那么我该如何使用UIActivityViewController做到这一点,因为我几乎使用了excludedActivityTypes之类的所有excludedActivityTypes,例如UIActivityTypePostToFacebookUIActivityTypeMessage等.

解决方案

您可以使用"Share"扩展名来做到这一点. 可能是微信开发人员未像Notes应用程序那样为纯"文本内容启用其Share扩展名.这是因为您看不到共享的扩展名.您将无法代表来添加WeChat Share扩展名.他们(如果他们不允许的话),但是您也许可以使用一些WeChat API来开发自己的启用了文本内容的应用程序扩展.

有关共享"扩展名的更多信息,请访问: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html#//apple_ref/doc/uid/TP40014214-CH5-SW1

尝试一下.

I am using UIActivityViewController for sharing PDF file, I have applied all code successfully to share .Pdf file, and when I see sharing sheet option there I can share or send my PDF file like Facebook, Gmail, Print, Copy etc but in my iPhone there some app also where we can share PDF file like WeChat, Open in iBooks, open in Hike, open in chrome etc but these option not shown on my share list like this image.

But when I use UIDocumentInteractionController then I saw all sharing option Facebook, Gmail, Wechat, open in iBooks, open in hike etc. All apps which support pdf shown as sharing option when I used UIDocumentInteractionController, show in below image.

But I want to use UIActivityViewController, and want to see all options which support PDF file like Wechat , open in iBooks, open in hike. Like this image....

So how can I do that using UIActivityViewController, which kind of excludedActivityTypes include in my pdf sharing file because I'm using almost all excludedActivityTypes like UIActivityTypePostToFacebook, UIActivityTypeMessage etc.

解决方案

You can do it by using "Share" extensions. May WeChat developers did not enable their Share extension for "pure" text content, like in the Notes app.That is reason you are not able to see that for sharing.You won't be able to add the WeChat Share extension on behalf of them if they didn't allow it, but you might be able to use some WeChat API to develop your own app extension with text content enabled.

For more information about "Share" extensions visit : https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW8

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html#//apple_ref/doc/uid/TP40014214-CH5-SW1

Try with this.

这篇关于如何在所有合格并显示iOS应用程序中共享PDF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆