My app is working fine on IPad and Iphone when i am testing.I am using AFNetworking 2.0 for API's Calling and apple app review is Rejecting My App Again & Again due to IPv6 Network,i am Using Hard coaded Ip address like http://192.230.66.71/XXXXXXXX/XX/ i am frustrated to this,Please Anybody help me what to do now.
-
Make sure you handle the received data safely. My app was rejected in same reason but I found the real problem is the received data could be nil under some circumstances, which is resulted in crashing the app. I pass the app review by fix that bug. – JsW Nov 12 '17 at 08:07
-
But when i am testing on device or simulator this working fine but apple review says it is crashing on ipv6 network – Vikas Rajput Nov 12 '17 at 15:32
-
Yeah, so what I am trying to say is it could be something else. For example, the app works fine under your network, but it could failed in other place like connection too slow and resulted in timeout. In that case, you will get some error data or empty data, then if you force unwrap data in your code, the app will crash. – JsW Nov 12 '17 at 15:49
-
Can you tell me one thing i am using hardcoded ip address api ihttp://192.230.66.71/XXXXXXXX/XX/ ,is this right or not ? – Vikas Rajput Nov 12 '17 at 16:35
-
this might help you : https://stackoverflow.com/questions/37693256/required-ipv6-compatibility-ios-app-rejected-by-apple/38196337#38196337 – miOS Nov 13 '17 at 07:35
-
Also you can create a test IPV6 enviornment and debug the issue. URL for configuration IPV6 http://blogs.perceptionsystem.com/ipv6-rejection-by-apple-developer-guide/ – miOS Nov 13 '17 at 07:36
1 Answers
You are not supposed to use hard code IP address according to the Apple's rule.
Don’t Use IP Address Literals Make sure you aren’t passing IPv4 address literals in dot notation to APIs such as getaddrinfo and SCNetworkReachabilityCreateWithName. Instead, use high-level network frameworks and address-agnostic versions of APIs, such as getaddrinfo and getnameinfo, and pass them hostnames or fully qualified domain names (FQDNs). See getaddrinfo(3) Mac OS X Developer Tools Manual Page and getnameinfo(3) Mac OS X Developer Tools Manual Page.
Note: In iOS 9 and OS X 10.11 and later, NSURLSession and CFNetwork automatically synthesize IPv6 addresses from IPv4 literals locally on devices operating on DNS64/NAT64 networks. However, you should still work to rid your code of IP address literals.
There are two things you should notice in my opinion:
1. Hard code IP address is not recommended, but according to the note above and the search I did that some developers pass the review with IPv4 address literals in their app.
So try not to use IPv4 address literals in your app first, then make sure you notice the second thing I mentioned following.
2. Your app could crash in other network related problems. Like what I comment before. I will paste it here to make things more clear to you.
Make sure you handle the received data safely. My app was rejected in same reason but I found the real problem is the received data could be server error under some circumstances, which is resulted in crashing the app. I pass the app review by fix that bug.
For example, the app works fine under your network, but it could failed in other place like connection too slow and resulted in timeout. In that case, you will get some server error data or empty data, then if you force unwrap data in your code, the app will crash. And In my case, Apple rejected my app with IPv6 issues, which is not the real problem.

- 1,682
- 3
- 22
- 34
-
no found solution , my app still rejected with same please help me. – Vikas Rajput Nov 16 '17 at 05:24
-
Sorry I was so busy these days. Do you pass the review now? There is one more thing you should notice that IPv6 is not supported by `reachability` class in AFNetworking 2.0. – JsW Nov 22 '17 at 16:25