Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:05:27+00:00 2026-06-02T19:05:27+00:00

I am building an app in xcode using the Cordova/phonegap framework for ios which

  • 0

I am building an app in xcode using the Cordova/phonegap framework for ios which displays some html that has some embeded youtube player code in it. iOS seems to redirect the user to the youtube app when it hits this youtube player. In cordova 1.5.0 the following code worked, but in 1.6.1 it doesn’t seem to. Any ideas why or what needs changing to get it to work?

code to stop youtube opening up and links to behave selves

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    NSURL *url = [request URL];

    // Intercept the external http requests and forward to Safari.app
    // Otherwise forward to the PhoneGap WebView

    NSString* urlString = [url absoluteString];
    if([urlString rangeOfString:@"http://www.youtube.com/embed"].location != NSNotFound) {
        return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
    }
    else if (([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"])) {
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    else {
        return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:05:28+00:00Added an answer on June 2, 2026 at 7:05 pm

    I would put logging in for url at the beginning of the method, and then a log statement in each clause of the if/elseif/else so you can see what urls are being intercepted and what the method then does with each one.

    Maybe the string for the youtube request doesn’t match the hardcoded “http://www.youtube.com/embed” any more? Worth a look.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am in the process of building my first iPhone app (xCode,objective-c) which has
I have an app that I'm building with XCode 4.2. It has push, and
I'm building a view in my iOS app with Xcode. I'm using the interfice
Building an iPhone app, using: Xcode 4.1 Base SDK iOS 4.3 Apple LLVM Compiler
I am building an iOS 5 app with ARC using clang on Xcode 4.2/Lion.
So I'm building an App using the Entity Framework on top of SQL Compact
I am new to iPhone development. I am building an app by using Xcode
Short introduction Working on my first commercial iOS app, XCode 3.2 has proven to
When building an iPhone app that uses the Core Plot framework, I am seeing
I finished building an app that allows beaming of photos, contacts and text clips

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.