0

I am trying to open a link into an external browser with phone gap 3.3.0 but i am having no luck. I added the plugin to the config file and phone gap is in the index.html file as well so i know those have loaded. I have an anchor that calls openURL(url) which then calls the following function.

    function openURL(urlString){
    var myUrl = encodeURI(urlString);
    window.open(myUrl,'_system');
}

as far as i can tell i have done everything right that is said in the documentation but it still will not load in safari on the iOS. I am testing on a iPad mini running IOS 7 but i have also tested it on android and i get the same issue.

Thanks in advance for any help you can provide.

Update

So I ended up bootstrapping angular which seems to have done something but when i open a link it appears without a toolbar

Ardenexal
  • 543
  • 6
  • 20
  • 2
    Have you seen this question? http://stackoverflow.com/questions/17887348/phonegap-open-link-in-browser Make sure you have the InAppBrowser plugin installed. – Keith Apr 22 '14 at 03:09
  • its definitely installed – Ardenexal Apr 22 '14 at 03:13
  • what about access origin have you set it to "*" to allow all the url , what log you are getting when opening a url with angular bootstrap – Vinodh Apr 22 '14 at 05:16
  • are you using phonegap build? or local phonegap? how did you install the plugin? – jcesarmobile Apr 22 '14 at 11:57
  • To fix the missing toolbar try: `window.open(url, "_system", "location=yes")` See [here](http://docs.phonegap.com/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html) for other options. – Keith Apr 22 '14 at 13:38
  • Im using phonegap build and it says the plugin is installed, I also did step through on the javascript with the ipad and it called the inappbrowser function, but nothing happens. I've tried using location=yes with no effect. I will test another plugin tokorrow and see if it has the same problem. – Ardenexal Apr 22 '14 at 14:06

1 Answers1

0

Have you seen this question? http://community.phonegap.com/nitobi/topics/pgb_3_3_open_link_in_external_system_browser_not_working_in_ios?rfm=1

need to add:
<gap:plugin name="org.apache.cordova.inappbrowser" /> in config.xml
<script src="phonegap.js<>/script> in your index.html (in head)

open link via:
<a href="#" onclick="window.open('http://www.google.de','_system', 'location=yes');">Test 6</a> manipulate html or:
window.open("http://www.google.de","_system");

Killuah
  • 21
  • 4