简体   繁体   English

如何在共享菜单中列出?

[英]How to get listed in the share menu?

I'm creating a messaging app and I would like to enable other apps to share text to my app via the share menu option. 我正在创建一个消息传递应用程序,我想让其他应用程序通过共享菜单选项与我的应用程序共享文本。

How do I get my app listed in there? 如何在我的应用程序中列出我的应用程序?

This is the menu I would like to get listed in: 这是我想要列出的菜单:
图片

In iOS 8, Apple has now enabled a way for you to add your application to a user's Share Sheet as one of many features of Extensibility, which aims to make your app available to the user even when closed. 在iOS系统中8,苹果现在已经启用了一个方法可以让你的应用程序添加到用户的共享表作为可扩展的许多功能,其目的是使你的应用程序提供给关闭,即使用户之一。

在此输入图像描述

You can read a lot more about share extensions here , or go straight to Apple's pre-release documentation to dive into the code. 您可以在此处阅读有关共享扩展的更多信息,或直接阅读Apple的预发布文档以深入了解代码。


Update: Above link of Apple documentation is not working, check here App Extension Programming Guide: Share 更新: Apple文档的上方链接无效,请在此处查看App Extension编程指南:分享

You can't automatically be added to the UIActivityViewController in other apps. 您无法在其他应用程序中自动添加到UIActivityViewController The only things that appear on that "share menu" are a few predefined apps that Apple has added support for, as well as any other app specific activities an app decides to add. “共享菜单”中出现的唯一内容是Apple已添加支持的一些预定义应用程序,以及应用程序决定添加的任何其他应用程序特定活动。

You can setup your app to appear in a list of apps for opening a file but that is not the same as what you are asking for here. 您可以将应用程序设置为显示在打开文件的应用程序列表中,但这与您在此处要求的内容不同。

You can do this by adding a few entries into your apps info.plist. 您可以通过在应用程序info.plist中添加一些条目来完成此操作。

Here's a post that should answer this for you. 这是一篇应该为你解答的帖子。 slashdot post 斜线的帖子

also here another link 还在这里另一个链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM