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

  • SEARCH
  • Home
  • 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 6095579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:49:40+00:00 2026-05-23T12:49:40+00:00

I have a web-app, that I’m trying to wrap as a native app. I’m

  • 0

I have a web-app, that I’m trying to wrap as a native app. I’m using a webView, to display the web-app. The app contains a lot of articles, and some of them, have links to external pages. When I tap these links, the webView will load the external page, and all my navigation disappears, and I’m essentially locked at the external site. I have no possibility of going back to the app, without quitting it completely.

What I want to do is, have a script that evaluates the URL’s before loading them in the webView. If the server differs from the one where I have the web-app, I want the link to launch mobile Safari. I have found a lot of scripts online, that does something like what I want, but not quite. They check for an href, and invokes the mobile Safari if the href is present. This will not work in my case, as pretty much all links in the App contains href’s.

I have an example of what I’m trying to do here:

NSURL *requestURL = [ [request URL] retain ];

if (( ![ [requestURL scheme] isEqualToString: @”http://www.some-site.dk/” ] )
&& ( navigationType == UIWebViewNavigationTypeLinkClicked ))
{
NSLog(@”Link opened in native Safari”);
return ![ [ UIApplication sharedApplication ] openURL: [
requestURL autorelease ] ];
}
NSLog(@”Link opened in webView”);
[ requestURL release ];
return YES;

How do I check if an url string is not equal to something in objective-c?

Any help will be greatly appreciated!

  • 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-05-23T12:49:40+00:00Added an answer on May 23, 2026 at 12:49 pm

    I ended up using the rangeOfString function to determine if the selected link included the domain name of the web-server containing the web-app. Everything else gets sent to the native Safari.

    Here’s an example:

    NSRange infoUrl = [filePath rangeOfString:@"DOMAIN_NAME.COM"];
    
    if (infoUrl.location == NSNotFound)
    {
         return ![ [ UIApplication sharedApplication ] openURL: [ requestURL autorelease ] ];
    }
    
    return YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: We have a web app that calls some web services asynchronously (from the
We have a web app that is using MVC Preview 3. I'm new to
Say I want to have a simple web app that takes some user input,
I have a web app that gathers some data from the user and saves
I have a web app that takes some client info and produces a letter
I have a web app that uses some backend servers (UNC, HTTP and SQL).
I have a web app that displays the details of some entity, let's call
I have a web app that is heavily loaded in javascript and css. First
I have a web app that only registered users can use, therefore I should
I have a huge web app that is having issues with memory leak in

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.