Cordova Android应用程序所有REST请求都处于待处理状态 [英] cordova android app all REST requests are pending

查看:108
本文介绍了Cordova Android应用程序所有REST请求都处于待处理状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将手机升级到Android 9后,Cordova应用程序停止工作

Cordova app stopped working after upgrading phone to 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请求都处于状态(待处理).

When phone is connected to wifi everything is working as expected, when switching to data over cellular, app stops working. I connected debugger, all GET requests are having status (pending).

我已经测试了REST客户端应用中通过蜂窝连接对API的访问,效果很好.

I've tested access to API over cellular connection in REST client app, it's working fine.

Cordova网络应用程序可以很好地处理此手机上的蜂窝数据.

Cordova web app works just fine over cellular data on this phone.

Android 9中发生了哪些更改,可能导致此行为?

What did change in Android 9 that can cause this behavior?

推荐答案

这可能是由Android 9(其中HTTPS为标准)中的安全更新引起的.检查线程.

this can be caused by a security update in android 9 where HTTPS is standard. Check this thread.

这篇关于Cordova Android应用程序所有REST请求都处于待处理状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆