External links or URLs do not work with telephony

I am trying to develop an application using phonegap (1.1.0), xcode4 and jqtouch. The problem is that I cannot open any external link. For example, if I write an anchor tag with this href attribute:

href = "http://www.google.com"

when I start the application and click the link, I get this error:

ERROR White List Failure: url = 'http://www.google.com/'

Like reading on another forum, the application should at least open a link to the safari, but this does not happen.

Another example. If I embed an image tag that links to an online source like this (in this I use tomcat to load the data)

src = "local: 8080 / myimage.jpeg"

it doesn't work either.

Is there any parameter I need to control in xcode?

Any idea or advice would be greatly appreciated. Thanks.

+6
source share
3 answers

I had this question yesterday. A newer version of PhoneGap requires adding external URLs to the white list.

I found a solution here: Link

+6
source

You must add the allowed URLs to the ExternalHosts array of PhoneGap.plist (or Cordova.plist).

For example, if you want to allow access to this URL http://www.myhost.com/path/file , add www.myhost.com as a new entry to the ExternalHosts array.

If you want to allow access to content in all Google subdomains (for example, maps.google.com, mails.google.com), you can add * .google.com as a new entry in the ExternalHosts array.

Attention when adding a node to the list! The small arrow must point down before you click on the + signal

+4
source

Just write a link like this for phonegap 2.4.X

<a onClick='window.open("http://www.google.com/", "_system");' href='http://www.google.com' /> 
0
source

Source: https://habr.com/ru/post/899208/


All Articles