Apple Mandatory - Test Celular Connection - Solved


Hello Everyone, today I’m not come to ask but share.

Like a Apple developer, I get some work here about the connection test that is mandatory for publish an app to the apple store (iTunnes Store) and I spend like a three days trying to find the solution… After I find, I decide to share here because I can’t find on this forum that helps me a lot, so here we go…

This tip, is for you that like me, have problems with Cordova Network Plugin on iOS:

First, and after you already have the plugin installed on your project, before you open your project on Xcode you’ll need to add and build your project with cordova…

cordova platform add ios
cordova build

after that you’ll need edit config.xml and add the lines:

<feature name="NetworkStatus">
<param name="ios-package" value="CDVConnection" />

and on your Index.html…

<script type="text/javascript">
    document.addEventListener("deviceready", onDeviceReady, false);
    // device APIs are available
    function onDeviceReady() {
        if( == Connection.NONE){
            alert("No Connection");

And dont forget to insert on you app run (app.js)

if (window.StatusBar) {
  // org.apache.cordova.statusbar required

// just this follow lines
if(navigator.connection.type == Connection.NONE){
alert(“Your message for no connection!”);

This simple steps should solve all your problems with network connections on Xcode Simulator and on your iOS device.

Hope this helps.