Client won't connect in React Native iOS Release Mode
Describe the bug I am using socket.io-client version 2.3.1 in a React Native app. The client connects just fine in debug mode. However, on a release build the client does not connect. I've seen a handful of StackOverflow posts about this but nothing conclusive as far as what to do.
How can we successfully use socket.io-client in a React Native app in release mode? Only worried about iOS at the moment.
Thank you!
Version I am using version 2.3.1
I have the same problem with react native 0.64.2 and socket.io 2.1.1
These errors are showing up in event connect_error
{"type":"TransportError","description": ["isTrusted":false, "message":"A operação não pôde se erro 2.)"}}
concluída. (KCFErrorDomainCFNetwork
I fixed this bug by updating my iphone to iOS 15.2
That sounds weird indeed. Were you able to debug the issue?
Same here!
I am experiencing the same ionic webview. Does anyone have any clue?
I coped similar things in my react-native project.
You can add this to info.plist file.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
This is really similar as we android:usesCleartextTraffic="true" in AndroidManifest.xml file.
@hdoublin if I understand correctly, in your case the problem was due to using plain HTTP, right?
@sajadspeed @JaekwanLee is that your case?
@hdoublin if I understand correctly, in your case the problem was due to using plain HTTP, right?
@sajadspeed @JaekwanLee is that your case?
I don't know, I don't remember :)
For future readers:
Please check our guide with React Native here: https://socket.io/how-to/use-with-react-native
Please reopen if needed.