1b0t 1b0t - 3 years ago 134
iOS Question

iOS open YouTube App with query (url schemes)

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

I tried:

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


But this will open Safari instead of the YouTube Application.

Answer Source

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.

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://

Reference: iPhoneURLScheme

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download