The application does not have a network connection

My iOS version of my application does not seem to want to connect to the Internet at all. Can someone point me in the right direction?

I have added the address to which I am trying to connect to the white list. Although I'm not sure where to start, as this is my first iOS app. I am not sure if there is any kind of error that I do not see.

The application builds perfectly and is pushed to the Simulator and the physical iPhone. He works on a simulator. The iPhone has a connection and can browse the web, so I know this is not a problem.

Let me know what else you might need to help with this, as I'm not sure what I need to provide.

Edit

The script below logs the user into the system using the backbone.js model, which sends an ajax request to the server. This works great on Android Build.

App.user = new App.model.user({ 'email' : $(event.currentTarget).find('#email').val(), 'password' : $(event.currentTarget).find('#password').val() }); 

User Model:

 App.model.user = Backbone.Model.extend({ defaults : { "email" : null, "password" : null, }, initialize : function () { this.save(null, { success : function (model, response) { App.loggedIn = true; App.navigate("menu", { trigger : true, replace : true }); App.menu(); }, error : function (model, response) { try { App.mainView.error(response.resultMessage); } catch (e) { console.log(e); } }, wait : true }); }, urlRoot : App.config.siteUrl + "/gateway/user" }); 
+4
source share
2 answers

I would try the following.

1) Have a dummy html page

 < html> < head> < script> window.location.href="Your absolute URL you are trying to reach" < /script> < /head> < body>Loading< /body> < /html> 

If this does not work, set the whitelist * and try again. If it works something is wrong as the whitelist is set

2) Find out if there is access to a secure URL. If it works on the simulator and does not work on the phone, see if the phone has access to the URL you are trying to hit. Try using a mobile safari.

3) Make sure you are using the right cordova file. (Cordoba .js is different from Android and IOS)

4) If the mobile safari can connect, they try to use the webview debugger, as indicated in this amazing post

+1
source

I think you need to fix you Cordova.plist :

http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html

0
source

All Articles