1
votes

I have added this code in launch function. This code is used to globally handled internet connectivity issue

 Ext.device.Connection.on({
       // scope: this,
        onlinechange: this.onlineChange
    });


  onlineChange: function (online, type) {
        alert(online + type);
    },

This works fine on the device when we build using sencha native packager, But fails when the same app is packaged using phonegap. The alert is not getting triggered using phonegap native packaging it will work only if i do sencha native packaging. I don't get any error messages, I don't get the alert and i have added this code in app.js file in the launch function, I am using sencha touch 2

1
What do you mean 'it fails' ? Do you get an error message ? Do you get the alert or not ? Also, where do you put this code ? - Titouan de Bailleul
i have added this in app.js launch function in sencha touch 2 - Ram
The alert is not getting triggered using phonegap native packaging it will work only if i do sencha native packaging. I don't get any error messages, I don't get the alert and i have added this code in app.js file in the launch function, I am using sencha touch 2 - Ram

1 Answers

1
votes

When packaging with PhoneGap, use PhoneGap's own Events instead:

document.addEventListener("online", yourCallbackFunction, false);

document.addEventListener("offline", yourCallbackFunction, false);