ERROR whitelist rejection: phonegap 3.4 - ios

Newbie to phonegap and mobile programming. I'm getting the whitelist error when trying to connect to a localhost url http:// localhost/.
I've added access origin="*" to /appName/www/config.xml and /appName/platforms/ios/www/config.xml
I'm using phonegap 3.4 and the iphone simulator in xCode 5.1. From everything I've been reading, it should be working but isn't. I'm wondering if there is a setting in xCode that's causing the problem? If I open my local site in a browser, it works.
Thanks!

Please see my below instruction try with anyone and let me know
The following examples demonstrate whitelist syntax:
Access to google.com:
Access to the secure google.com
(https://):
Access to the subdomain
maps.google.com:
Access to all the
subdomains on google.com, for example mail.google.com and
docs.google.com:
Access to all domains, for
example, google.com and developer.mozilla.org:

Related

didFailProvisionalLoadForFrame for certain URL but works fine in Safari

I've got an odd issue where a certain domain fails to load in a WKWebView. It gives an error:
WebPageProxy::didFailProvisionalLoadForFrame: frameID=3, domain=NSURLErrorDomain, code=-1200
Which I believe is complaining about a certificate issue? It works fine if I allow insecure content via info.plist, but of course I don't want to allow that.
The cert is fine for that domain. I'm unable to share the url unfortunately. It's a .gov domain. The cert is DigiCert and not-expired.
It works fine in Safari outside of the app, and even in Firefox and Chrome, which I thought used WKWebView but maybe not?
Has anyone ever experienced this issue? What additional steps can I do to pin down what exactly WKWebView is complaining about and what can be done to fix it?
We're actually using Xamarin, but we have test projects in both Xamarin and Xcode that replicate the issue.
Thanks!
I found the problem!
WKWebView (unlike Safari) requires that SSL certs support forward secrecy.
https://developer.apple.com/documentation/bundleresources/information_property_list/nsexceptionrequiresforwardsecrecy
You can check if a cert supports this here:
https://www.ssllabs.com/ssltest/analyze.html
It's possible to disable it in info.plist but we've opted to ask the site owner to change their certs.

Is there an way to Inspect a broken link in an app?

We have an iOS app that has a Watch Tutorial link to our website. We recently migrated our website and the page it points to is now showing a 404 error. We need to know what page the link points to so we can redirect it. Unfortunately in the app it just opens link to the page in the actual app and not in safari or any other browser so we can't see the website link.
Is there a way to "inspect" the link in our app like you can in a browser to see where it is pointed to? Maybe some debugging software that can pull the app down and let me look at it? Our app developers are unavailable right now and we want to get the app up and running correctly.
You can try with the Safari Web Inspector (Safari mac remotely debugging on an iPhone app/safari).
With this approach, you can inspect from you mac, any WebViews (or related) in actual apps.
Note : It won't work if you app make the request, but does not use web view to display the page.
See any tutorial on how to enable safari web inspector
Maybe some debugging software that can pull the app down and let me look at it?
You can use a web proxy such as Charles to easily see all the traffic going to and from the app:
Install the proxy software on your computer.
Set the device to proxy through your computer.
If needed, install SSL certificates that will let the proxy see the contents of TLS connections.
Fire up the proxy, launch the app, and watch the traffic.

Does Phonegap mobile app require having "Access-Control-Allow-Origin:*" on server?

I'm developing an ios app with phonegap and Jquery. I'm facing an issue where sending ajax request failed due to the xmlhttprequest-cannot-load No 'Access-Control-Allow-Origin' header is present on the requested resource error. I have white-listed all domain with < access origin="*" / > in config.xml.
However adding Access-Control-Allow-Origin:* on server could resolve the issue. But I don't want to use this approach because this exposes another security issue. Does Phonegap app requires this? I'm confused because someone says yes and someones says no, and official documentation doesn't mention this either.
I just got the answer. phoneGap does not need this. What I'm experiencing is a known bug in the latest phoneGap (https://github.com/phonegap/phonegap-app-developer/issues/169) which should be resolved soon.
Not on the server no.
You can whitelist the origin though: http://docs.phonegap.com/en/3.0.0/guide_appdev_whitelist_index.md.html

itms-services IPA wireless distribution link not working

I'm trying to get an IPA downloadable through a website. From reading around I see this is done itms-services.
My issue is my link in php is not working - I have a feeling it's down to the syntax but i can't figure it out. I tried url encoding etc but no luck.
Any ideas?
echo 'Click here to donwnload</br>';
This is what Apple answers themselves on this question:
Yes, the itms:// type links don't work in the simulator.
You'll need to url encode just the url. So instead of
http://localhost:8888/hockey/hockey/appname_type/info.plist
you use this
http%3A%2F%2Flocalhost%3A8888%2Fhockey%2Fhockey%2Fappname_type%2Finfo.plist
I "think" the URL must now be HTTPS vs HTTP, per Apple security change.
Is your url to your ipa-file in the info.plist correct?
It needs to be the absolute url, f.e.
<key>url</key>
<string>http://localhost:8888/hockey/hockey/appname_type/info.ipa</string>
and it shouldn't be in a .htpasswd secured directory.
Unless you are running a jailbroken iOS device that's got it's own web server, a localhost url will notwork. I suspect your localhost reference works in Safari on your mac because it is running a web server that is serving up the files.
You'll need to specify the IP address for the Mac in your link, like
Click here to donwnload</br>';
but replace 192.168.0.100 with the IP address of your Mac.
Note that this won't work in the simulator, since you cannot install apps through the itms-services

iOS7 itms-services scheme not work?

I have an in-house app which I distribute over a local wifi
in release page have a link like this
itms-services://?action=download-manifest&url=http://192.168.1.231/app/plist/houseApp/out.plist
this worked on iOS 7 Safari
but when i add this page to main screen (like web app)
the same link didn't work, and apache access.log have no record about /app/plist/houseApp/out.plist
this worked in iOS 6
Anybody knows about this?
On the 7.1 update all software installation services are forced to use the HTTPS protocol, also covering non-standard itms-services:// URLs.
You need to change the protocol type:
from: itms-services://?action=download-manifest&url=http://yourdomain.com/manifest.plist
to: itms-services://?action=download-manifest&url=https://yourdomain.com/manifest.plist
For more detail and how to get a certificate go to: Fix certificate error on iOS 7
It seems Apple have disabled all URL schemas in iOS7 (including mailto: links) in standalone webapps. This has seriously implications for my place of work.
See this post: https://discussions.apple.com/thread/5385948?start=0&tstart=0
This worked for me in iOS 8.0. Simply use https for URLs.

Resources