-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Description
When developing for iOS on a real device, you might have to set an IP address of your Mac in the RCTWebSocketExecutor.m
file, instead of using localhost, otherwise you're not able to connect to it. I don't know if this is caused by strict policy of those who manage Wi-Fi in the offices or whatever, but it doesn't matter.
The main issue here is that the packager is using HTTP, not HTTPS and ATS policy on iOS disallows any insecure traffic for anything that's not localhost. Also, Apple doesn't allow you to create an exception in the Info.plist
file for an IP address, only domain. So you have to use some cumbersome workaround like this one: https://stackoverflow.com/a/45798216/3979621
Please consider switching to HTTPS. It took me half a day to get around this problem, and I'm sure I'm not the only one.