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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:24:33+00:00 2026-06-17T08:24:33+00:00

Just installed phonegap 2.3 and tried to open a maps link that i’ve created.

  • 0

Just installed phonegap 2.3 and tried to open a maps link that i’ve created. This was working perfectly fine until the update.

I have tweaked the URL scheme to suit the ones in here and i have also tried feeding it a normal url, no matter what i do, i cannot seem to get it to load a link outside the app, whether it be a browser window or the native maps app..

Code:

openDeviceMapsApplication: function(address, lat, lon) {
    var query = '?';

    address = address + ", Australia";
    address = encodeURI(address);

    if (address[0] !== '.') {
        query += 'q=' + address + '&';
    } else {
        query += 'q=' + lat + ',' + lon + '&';
    }

    query += 'z=15';


    var url = 'http://maps.google.com/maps';
    var osVersion = "not detected";

    console.log("detect");

    if(/OS [2-4](_\d)(_\d)? like Mac OS X/i.test(navigator.userAgent)) { //is it ios 2-4?
        url = 'http://maps.google.com/maps'; osVersion = "ios 2-4";
        console.log("ios2-4");
    } else if(/CPU like Mac OS X/i.test(navigator.userAgent)) { // ios 1?!?!
        url = 'http://maps.google.com/maps'; osVersion = "ios 1";
        console.log("ios4");
    } else if(/OS [5](_\d)(_\d)? like Mac OS X/i.test(navigator.userAgent)) { //ios 5?
        url = 'http://maps.google.com/maps'; osVersion = "ios 5";
                        console.log("ios5");
    } else{//ios 6 or greater
        url = 'http://maps.apple.com/'; osVersion = "ios 6 or greater";
                        console.log("ios6");
    }

    url += query;
    console.log(url);
    window.location.href = url;
    return;

},

Does anyone have a workaround?

PS, the os detection works and is ugly.. but it works 🙂

  • 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-17T08:24:33+00:00Added an answer on June 17, 2026 at 8:24 am

    Ok, so after much searching and false leads i have found that the URL’s are handled differently in this version of Cordova/Phonegap.

    So i found the delegate:
    — edit this delegate method is in CDVViewController.m as part of the Cordova project

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

    And added an if-case. The check basically says “is the URL (https or http) and is the URL for (maps.google.com/maps or maps.apple.com – for ios 5 and 6 respectively)

    if (([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"] || [[url scheme] isEqualToString:@"itms-apps"]) &&
                 (([url.path rangeOfString:@"maps.google.com/maps"].location == NSNotFound) || ([url.path rangeOfString:@"maps.apple.com"].location == NSNotFound))) {
            [[UIApplication sharedApplication] openURL:url];
            return NO;
        }
    

    This fixed the issue for maps, there may be some other URL based application references that this doesn’t solve.

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

Sidebar

Related Questions

I just heard about phonegap that this is framework which let developers make web
I just installed the childBrowser plugin on Cordova(PhoneGap) for iOS and it works fine,
I just downloaded Eclipse Galileo and installed ADT10 and tried to a phonegap app
I just installed Fedora in a virtual machine, and when I open vim, my
I just installed python2.6 parallel to my python2.4. I ran this command ln -s
just installed new ubuntu vm to test around with node installed things in this
I just installed visual studio 2012 and tried running my C++ project on it.
Just installed Django (with easy_install) and created a project, but can't get mysql to
I just installed Emacs on my mac from here: http://emacsformacosx.com/ and that got rid
I just installed Rails, etc. on a Windows 7 machine. Created my first app,

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.