How to get listed in the share menu?

亡梦爱人 提交于 2019-11-28 00:24:48

问题


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:


回答1:


You can't automatically be added to the UIActivityViewController in other apps. 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.

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.




回答2:


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.

You can read a lot more about share extensions here, or go straight to Apple's pre-release documentation to dive into the code.


Update: Above link of Apple documentation is not working, check here App Extension Programming Guide: Share




回答3:


You can do this by adding a few entries into your apps info.plist.

Here's a post that should answer this for you. slashdot post

also here another link



来源:https://stackoverflow.com/questions/16107446/how-to-get-listed-in-the-share-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!