ios - 启动没有 UI 的 iOS 扩展

标签 ios uidocumentinteraction ios-extensions

我必须在没有任何用户交互的情况下在 iOS 应用程序之间共享数据。

经过一番谷歌搜索后,我发现最好的方法是使用 Extension。根据 Apple 扩展指南,用户通过与某些系统提供的用户界面交互来打开应用程序扩展。例如,用户通过激活应用程序中系统提供的共享按钮并从显示的列表中选择扩展来访问共享扩展。

我的问题是我们可以在没有任何 UI 按钮的情况下访问 share/action/documentProvider 扩展。我们可以自定义扩展程序的启动方式吗。

是否有任何其他安全的应用程序间通信方式。

最佳答案

假设共享中涉及的所有应用程序都是由您开发/控制的,实现此目的的最佳方法是 shared container .根据文档:

The com.apple.security.application-groups (available in OS X v10.7.5 and v10.8.3 and later) allows multiple apps produced by a single development team to share access to a special group container. This container is intended for content that is not user-facing, such as shared caches or databases.

In addition, this attribute allows the apps within the group to share Mach and POSIX semaphores and to use certain other IPC mechanisms among the group’s members. For additional details and naming conventions, read “Mach IPC and POSIX Semaphores and Shared Memory” in App Sandbox Design Guide.

关于ios - 启动没有 UI 的 iOS 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36452446/

相关文章:

ios - 如何根据对应的UIImageView的尺寸来决定1x、2x、3x的图片尺寸?

objective-c - 更改 UIDocumentInteractionController 导航栏的颜色

ios - 过滤 UIDocumentInteractionController 建议打开方式的应用程序

iOS - 如何将文件从一个应用程序发送到其他特定应用程序

watchkit - 防止 Apple Watch 关闭屏幕

ios - 2 MB的GIF图像占用8 MB的内存

ios - 对请求使用共享的 WKWebViewCookies

ios - "Shake"的 Sphero 概念?

ios - iOS App Containing Extension 和 Extension (not Host App) 之间如何通信

ios - 在IOS9中自动显示的新添加的 'My Card'是否是获取用户电话号码的可靠方法?