Web development Birmingham

Fix: Internet connection not working with PhoneGap / Cordova app once published to the app store

We build a lot of our mobile applications in a front end development framework (e.g. AngularJS) ontop of a phone development framework that allows you to program in web languages, such as: PhoneGap, Cordova, Ionic. Today we had a pretty unusual bug which I'm writing about now as it was a real pain to find the solution to.

The issue: The app we had been making was working fine in debug mode, and even within the Apple app store, however the app broke when we published the application to the Google Play app store as the internet connection component of the app stopped working.

The annoying thing with this problem is that it went away as soon as we re-enabled debug mode, which by it's nature made it particularly difficult to debug! Most articles were proposing the solution of enabling the right permissions and access origins, which we already had in place:

Setting this in config.xml:
<access origin="*" />

And this in AndroidManifest.xml:
<uses-permission android:name = "android.permission. INTERNET" />
<uses-permission android:name = "android.permission. ACCESS_NETWORK_STATE" />

This wasn't the solution for us, but maybe it will work for you.

Using an SSL certificate? Us to! The issue was actually down to the way our SSL certificate had been configured. When we had installed the SSL certificate, we had not properly installed "intermediate certificates". If you set up your SSL certificates in something such as WHM then this essentially means that or haven't proprly completed the "Certificate Authority Bundle (optional)" input area. If you reinstall the certificate and ensure this validates correctly then it should fix the problem without the need to re-deploy the application to the app stores.

To give you some background, the app we made communicated with our web server to get the data the drives it. Some of this data is sensitive so we wanted to protect the infrastructure from man-in-the-middle attacks which is why the SSL certificate was neccessary.

Did you find this article useful? Sharing is a great way to show support, and ensures that we can continue to create more quality articles:

Get a free quote