gpt4 book ai didi

ios - 如何将文本从 iOS Notes 应用程序导出到我的应用程序?

转载 作者:行者123 更新时间:2023-11-29 00:00:43 26 4
gpt4 key购买 nike

我知道这是可能的,并且是许多大型应用程序所做的事情,但我无法在 UTI、扩展、UIActivityTypes 等中找出我需要特别使用的拼写。我正在尝试将我的应用程序添加到当您点击 iOS 上的“便笺”应用程序中的“导出”按钮时出现的应用程序列表中,因为我希望能够在便笺中获取一堆文本,并重复且安全地将其发送到我的应用程序中。应用程序。

I want my app to appear in this list, exporting directly from Notes.这个问题似乎有重复,很古老,声称“第三方应用程序无法从 Notes 应用程序导出”,但我认为他们现在要么是错误的,要么回答了不同的问题,因为正如您在上面看到的屏幕截图,Messenger 显然能够做到这一点。

看起来注册尿路感染并不能帮我完成这件事。我继续将我的应用程序注册到各种 UTI,但所发生的只是我的应用程序最终出现在像 this one, which appears when trying to open a txt file 这样的弹出窗口中。 ,这不是我要找的。除非有其他一些不符合我需要使用的 public.data 或 public.content 的 UTI,在这种情况下我很乐意听到它。

最佳答案

我使用了我分配的支持请求之一来询问 Apple,经过一段时间来回,我能够得到我的答案!他们是这样说的:

Your project is missing a Share app extension. Start by reviewing the App Extension Programming Guide: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/index.html#//apple_ref/doc/uid/TP40014214-CH20-SW1

Information specific to the Share extension point: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Share.html#//apple_ref/doc/uid/TP40014214-CH12-SW1

You don’t need to register the text content type in your CFBundleDocumentTypes. as you’ve done in your sample. However, you will need to provide an activation rule for the extension point, such as the one shown in this section of the document (the section titled Declaring Supported Data Types for a Share or Action Extension): https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1

See specifically the predicate example that activates the extension if an attachment with the com.adobe.pdf UTI is present. You will need to do something similar, to cover the UTIs for content you would like your share extension to consume. As a starting point, you can consume text with the public.text UTI. For more common UTIs, please see this document: https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1

我还发现有关提供激活规则的部分非常令人困惑,这个答案对此有所帮助:How do I set NSExtensionActivationRule predicates?

关于ios - 如何将文本从 iOS Notes 应用程序导出到我的应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49549025/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com