iOS 使用查询打开 YouTube 应用(网址方案) [英] iOS open YouTube App with query (url schemes)

查看:38
本文介绍了iOS 使用查询打开 YouTube 应用(网址方案)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有 URL Scheme 可以使用指定的搜索查询打开 YouTube iOS 应用?

Is there an URL Scheme to open the YouTube iOS app with a specified search query?

我试过了:

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

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

But this will open Safari instead of the YouTube Application.

推荐答案

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

You can't use this http://www.youtube.com/results?search_query=foo for opening youtube app. If you use the above url it'll open the safari instead of youtube app.

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

There are only three URLSchemes available for opening youtube app:

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

参考:iPhoneURLScheme

这篇关于iOS 使用查询打开 YouTube 应用(网址方案)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆