studioab
studioab

Reputation: 1

cordova android app all REST requests are pending

Cordova app stopped working after upgrading phone to Android 9

Here is the code that is sending requests

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);
            });

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).

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

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

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

Upvotes: 0

Views: 469

Answers (1)

alfalfa
alfalfa

Reputation: 85

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

Upvotes: 4

Related Questions