Cordova应用程序在将手机升级到Android 9后停止工作
下面是发送请求的代码
fetch('http://mydomain/restapi/example', { method: "GET" })
.then(handleErrors)
.then((response) => response.json())
.then((responseData) => {
console.log(responseData);
UpdateCurrentTemp(responseData);
GoodConnections++; // count sucessful connections
isConnected = true;
})
.catch((error) => {
ErrorConnections++;
console.error(error);
});当手机连接到wifi时,一切都像预期的那样工作,当切换到蜂窝数据时,应用程序停止工作。我已连接调试器,所有GET请求都处于状态(挂起)。
我在REST客户端应用程序中测试了通过蜂窝连接访问API,它工作得很好。
Cordova web应用程序在这部手机上的蜂窝数据上工作得很好。
Android 9中的哪些变化会导致这种行为?
发布于 2018-10-22 16:00:24
这可能是由android 9中的安全更新引起的,其中HTTPS是标准的。检查this线程。
https://stackoverflow.com/questions/52923666
复制相似问题