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 8591821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:36:35+00:00 2026-06-11T23:36:35+00:00

I have a UIWebView in my application that loads a mobile website. The mobile

  • 0

I have a UIWebView in my application that loads a mobile website. The mobile website then has lots of different links.

One of those links will try and load a map using Google Maps.

Initially, I had a problem where the user clicked the maps link, as the application would try to load the maps inside my webview. What this does, is make the user stuck, as once you’ve loaded maps inside the webview, there’s no way to go back.

enter image description here

The only way for you to the go back, is by force closing the application, so not ideal.

I then found other people having the same problem, and implemented the solution as described here.

This worked great, and now upon clicking the map link, it opens up the maps application. In order to go back to the original application, I can simply double tap the home button, and select my application on the list of running applications.

However, this brought another problem. When I select my application again, it briefly displays the contents back, and then opens the following popup:

enter image description here

No matter what you chose there, it then loads up the maps again, but inside of the webview this time, which negates all the work done as described previously.

Has anyone here seen this kind of behaviour, and if so, do you know how to go around it, so it doesn’t even open the popup asking for your current location?

UPDATE
Adding the code I;m using to handle it

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

    // URL Starts with "http://maps?"
    if([[request.URL description] hasPrefix:@"http://maps"]){
        [[UIApplication sharedApplication] openURL:request.URL];
        return NO;
    }
    // otherwise let the webview deal with the request
    return YES;
}

Thanks in advance,

  • 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-11T23:36:37+00:00Added an answer on June 11, 2026 at 11:36 pm

    based on your additional comments below, i’ve edited this answer to focus on the second solution i had originally proposed:

    • in one app that i have, in which i go to visit external web sites, in my storyboard, i have created a view containing a UIWebView and a UIButton that is a back button. you could do this and just have the UIWebView load the map as you would like and go from there.

    the .xib would look something like the following … paying special attention to the fact that the done button is last in the subview order so that it can sit on top of the webview if desired (yes, the webview could be made to take up 100% of the superview real estate, and the button could sit on top of it; it just does not in this example app i used) (and ignore the background image; in the example app i used to take this screenshot, it is used behind a partially transparent webview; if this is desired, make sure it appears first in the subview order of the .xib view so that it is “behind” all other subviews).

    enter image description here

    and the code you would need for this would be in the view controller associated with this .xib, and would look something like the following:

    @interface WebGoogleMapInUIWebViewViewController () <UIWebViewDelegate>
    
    @property (nonatomic) int backCount;
    
    #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3
    @property (readonly, weak, nonatomic) IBOutlet UIWebView *webView;
    #else
    @property (readonly, unsafe_unretained, nonatomic) IBOutlet UIWebView *webView;
    #endif
    @end
    
    @implementation WebGoogleMapInUIWebViewViewController
    
    @synthesize webView;
    
    // … UIViewController life-cycle code and all other code goes here …    
    
    #pragma mark - Actions
    
    - (IBAction)done:(id)sender
    {
        if (self.webView.canGoBack) // relying on false for a nil webView
            [self.webView goBack];
    }
    
    @end
    

    this solution should allow you to stay inside of your app, and then if you do get to the dialog asking for the location, the result should be immediate and apply back only inside of your app.

    i know this doesn’t solve the problem the way you’ve stated it, but it might give you the behavior you want.

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

Sidebar

Related Questions

I have a UIWebView in my application which has links inside that when clicked
I have a jquery-mobile application that is running inside a UIWebView in an iphone
In my application, I have a UIWebview that loads linkedin auth page for login.
I have a UIWebView that loads a link, http://www.google.com/a/datacommsales.net . But I want to
HEllo, I have a hybrid iPhone application that has a UITabBarController and 5 Tabs.
I have a website that is set up as an application underneath another site
I have a ViewController embedded in a NavigationController. The ViewController has a UIWebView that
I have a native application that uses a UIWebView and notice that with sites
I have an application that shows presentations that are composed by pages. Those pages
I currently have the following code that loads a UIWebView from another View. Now

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.