I have a phonegap app that is working on every Android Version except 9 Pie.
Navigating to a website works. That means my allow-navigation tags must be correct. But sending a XMLHttpRequest I get no data.
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
if(xmlhttp.status==200){
var info = xmlhttp.responseXML;
if(info!=null){
//doLog(xmlhttp.responseText);
...
}
} else {
doLog("Server answer: " + xmlhttp.status + " " + xmlhttp.statusText);
}
}
}
xmlhttp.open("GET", serverURL + url, true);
xmlhttp.send();
I read you need minSdkVersion of 17 for apps to work with android 9. Mine has 19 already. TargetSdkVersion is 28.
Of course I use whitelist plugin.
<preference name="phonegap-version" value="cli-8.2.2" />
<preference name="keepRunning" value="true" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
<preference name="android-build-tool" value="gradle" />
<access launch-external="yes" origin="geo:*" />
<access launch-external="yes" origin="mailto:*" />
<access launch-external="yes" origin="http://*" />
<access launch-external="yes" origin="https://*" />
<access origin="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
Anyone an idea?