TL / DR
如何使iOS应用程序出现在共享表上以接收来自其他任何应用程序的共享URL?
This is a super newbie post as I have never really touched swift to develop anything, but I couldnt find the answer to my question on google so i wanted to start here. Almost everything I found by googling around is UIActivityViewController
which appears more to be about how to share content from my app to another app; while what I am trying to do is share urls from another app to my app.
我正在尝试为ios构建一个简单的应用程序(不必与旧版本兼容,因为它只会由我使用),可以作为Safari,brave或youtube等应用程序的共享网址的接收者。当用户单击“共享”按钮,然后选择该应用程序时,该应用程序所做的全部事情就是,该应用程序获取正在传递的相关数据,然后将其发布到后端服务器。
I can accomplish this on my android app/devices with an intent filter action android.intent.action.SEND
in the manifest, and then listening for it with Intent intent = getIntent()
in my method.
有人会友善地将我的研究方向指向正确的方向吗(关于Google)。如果您还可以指出一些示例代码示例,说明如何编写可作为共享数据接收方(例如url)的接收器的应用程序,那就太好了。我不确定要搜索什么,以便我的应用程序可以显示在共享表上,以及如何处理数据。
再次,对超级菜鸟问题表示歉意,但我无法将我的想法翻译成与Google相关的内容。
可以通过动作扩展来实现。搜索它。
Here is one: https://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794