Adding my app as a sharing option in the Youtube app

微笑、不失礼 提交于 2019-12-11 04:15:02

问题


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.


回答1:


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>

And then your app will show up in the chooser when a user shares something from youtube.

EDIT: For iOS it is not as easy (not possible with lower iOS versions). Take a look at this question for more information about why.



来源:https://stackoverflow.com/questions/38589145/adding-my-app-as-a-sharing-option-in-the-youtube-app

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