0

I get a network problem. It shows code -1004 message:Could not connect to the server.It works right on 4G, but there is a bug in wifi: it shows the error. Sometimes, it works well, but sometimes it doesn't work.

I use android with same host address. On 4G and wifi, it all works right. I have no ideas. What's wrong.

2
  • Please check for ATS in your plist for HTTP calls. Also, try to run the app in the mobile device not in Simulator.
    – Gagan_iOS
    Jul 30, 2018 at 6:53
  • ths.ATS i use this:NSAllowsArbitraryLoads true.my host address is http. I use mobie not simulator
    – wei mao
    Jul 30, 2018 at 7:01

1 Answer 1

0

We run into the same problem in recent project during test, now I know the reason is we are using a limited Wi-Fi, the router has some Qos rule, some tcp connections are randomly abandoned by the router, error - 1004 occurs, sad! Hope this info helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.