iOS 打开带有查询的 YouTube 应用程序(url 方案)

标签 ios search youtube

是否有使用指定搜索查询打开 YouTube iOS 应用程序的 URL 方案?

我试过:

NSString *stringURL = @"http://www.youtube.com/results?search_query=foo";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

但这将打开 Safari 而不是 YouTube 应用程序。

最佳答案

您不能使用此 http://www.youtube.com/results?search_query=foo 打开 youtube 应用程序。如果您使用上述网址,它将打开 safari 而不是 youtube 应用程序。

只有三个 URLSchemes 可用于打开 youtube 应用程序:

  • http://www.youtube.com/watch?v=VIDEO_IDENTIFIER
  • http://www.youtube.com/v/VIDEO_IDENTIFIER
  • youtube://

引用:iPhoneURLScheme

关于iOS 打开带有查询的 YouTube 应用程序(url 方案),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18695537/

相关文章:

date - Elasticsearch-范围查询不起作用

c# - 在列表中搜索组合

api - 在 youtube API 3 中需要用户身份验证或开发人员注册应用程序就足够了吗?

iphone - “Format not supported Error”在iPhone应用程序中播放youtube视频时

ios - 从 segue 返回后,UIButton 中心移回默认位置

iOS 属性字符串高度

ios - tableView.dequeueReusableCellWithIdentifier VS tableView.cellForRowAtIndexPath

algorithm - "hill climbing"和 "branch-and-bound"搜索算法有什么区别?

php - Youtube-DL 文件下载实时进度

iphone - 通过 Apple iPhone Earpods 控制 AVAudioPlayer