IOS Share扩展:如何阅读笔记帖子 [英] IOS Share extension: how to read from notes posts
问题描述
我希望我的应用能够解析笔记应用帖子中的文本以及其他文本编辑帖子,因此我创建了一个共享扩展目标。一切正常,直到我准备应用程序发布,用
NSExtensionActivationRule替换 TRUEPREDICATE
。
I want my app to be able to parse text from notes app post as well other text editors posts, so i created an share extension target. Everything worked fine until i prepare the app for publish, replacing the TRUEPREDICATE
by
NSExtensionActivationRule.
据说,在我的共享扩展目标中,我应该将NSExtensionActivationSupportsText密钥添加到info.plist中的NSExtensionActivationRule,我这样做了,但我的应用扩展程序仍未显示在共享表中。
Supposedly, in my share extension target, i should add NSExtensionActivationSupportsText key to NSExtensionActivationRule in info.plist, which i did, but still my app extension doesn't show up in the share sheet.
根据 https://developer.apple。 com / library / ios / documentation / General / Conceptual / ExtensibilityPG / ExtensionScenarios.html 我的info.plist应该包含:
According to https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html my info.plist should contain this:
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<integer>1</integer>
</dict>
</dict>
我尝试启用其他类型,如附件,文件,网页,但没有效果。
I try enable also other types like attachments, files, web pages, but had no effect.
推荐答案
至少在iOS 9中,正确的代码是
At least in iOS 9, the correct code is
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
</dict>
作为参考,这通常是文本共享扩展支持所需要的:
For reference, this is typically what it would like for text share extension support:
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationUsesStrictMatching</key>
<integer>2</integer>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationDictionaryVersion</key>
<integer>2</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
</dict>
</dict>
这篇关于IOS Share扩展:如何阅读笔记帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!