问题描述
是否可以将我自己的应用添加到共享应用列表中?这个想法是,安装了我的应用的用户可以选择将YouTube视频分享给我的应用,因此当他们单击该选项时,我的应用会打开,我会从中收到一些东西.
Is it possible to add to the list of sharing apps my own app?.The idea is that users that have my app installed have the option to share YouTube videos to my app, so when they click the option my app opens and I receive something from it.
推荐答案
对于Android:将传入意图过滤到您的活动中以捕获发送意图:
For Android: Filter incoming intents to your activity to catch the send intent:
<activity ...>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="www.youtube.com" android:mimeType="text/*" />
</intent-filter>
</activity>
然后,当用户与youtube分享某些内容时,您的应用就会显示在选择器中.
And then your app will show up in the chooser when a user shares something from youtube.
对于iOS,这并不容易(较低的iOS版本无法实现).请查看此问题以了解更多有关原因的信息.
For iOS it is not as easy (not possible with lower iOS versions). Take a look at this question for more information about why.
这篇关于在YouTube应用程序中将我的应用程序添加为共享选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!