ios https network error


#1

The app is detached.

I can use a http url and it works fine, but not the https url. The https url works fine in postman.

I get [TypeError: Network request failed] when I use the https url.

Nothing special about the code. It fails whether I run it through the emulator or my phone. It has to be some sort of permissions error maybe?

fetch(url, {
method: ‘POST’,
body: JSON.stringify(data),
})
.then((res) => {
console.log(‘res’, res);
callback(true, res.data, null);
})
.catch((error) => {
console.log(‘error’, error);
callback(false);
})
.done();


#2

What is the error message?
The https has a valide certificate?


#3

read above please and yes the server has a valid cert (hosted on amazon)


#4

This is the Type Error, in your code u can
console.log(e) -> that will print [TypeError: Network request failed]
or
console.log(e.message) -> that will show more info about the error.
or even
console.log(JSON.stringfy(e)) -> that will show an json with ALL error info.


#5

Older Android phones might have trouble with Amazon TLS certificates because Amazon was not a root CA back then. Unclear if that’s your issue but I would look at ADB logs and your Android certificate store to see if this could be it.


#6

No. This is an ios app.


closed #7

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.