This is the second time I encountered this problem after 6 months. It used to be in an Objective-C project using AFNetworking, and I used this solution, and it worked in one way. The same thing happened with Alamofir. Guys, this solution works for me 2 times, and I found that this question comes first in google, so I am posting the answer.
Locate AF_INET in the workspace and change it to AF_INET6 anywhere. I think it should be inside the AFNetworking library or the Alamofire library if you use it. Its in the class NetworkReachabilityManager.
I found this answer from the source below.
stack overflow
EDIT: - June 24 -
It has helped me so many times, but there is a strange solution to this problem. In our recent project, we applied this solution, but still the apple rejected the application. Then we made a video in which it was shown that the application was working fine by connecting to the NAT64 network created on Mac from the wifi sharing option. We applied for viewing with the video, and they approved the application. Therefore, if you are done with all your options, try this too.
Mahesh Agrawal Apr 03 '17 at 6:40 2017-04-03 06:40
source share