I realize an application with which I'm supposed to send data via http with $ .getJSON.
My problem: When I test with chrome or another browser its pass but when I generate the apk and I test on a phone its does not pass.
I think that it is certainly a problem of configuration of cordova (version 6.4.0)
JS
function jsoncallback(data){
alert(data.service+" bien enregistré");
$('#load').show();
$('#imload').hide();
}
function Service(service) {
var var1 =$('#var1').val();
var var2 =$('#var2').val();
if(var1 == 0 || var2 == 0){
alert('Service impossible.. ');
}else{
if(confirm("Choix : "+var1+" | "+var2)){
$('#load').hide();
$('#imload').show();
$.getJSON("http://xxxx.xxxx.xx/service.php?var1="+var1+"&var2="+var2+"&jsoncallback=?");
}
}
}
Config.xml
<access origin="*" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>