Forum Xamarin.iOS

IOS App Rejection (IPV6 support)

kavikumar.9960kavikumar.9960 USMember
edited January 2017 in Xamarin.iOS

I added SOAP Webservice to my project as WebReference.When i submitted my app iTunes rejected my app reasoning that "Your app crashed on iPhone running iOS 10.2.1 connected to an IPv6 network ".


  1. I changed my HttpClientImplementation from "Managed" to "NSUrlSesion",then i submitted and got rejected.
  2. I changed the info.plist adding
    <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
    Then i submitted and again got rejected.

  3. And again i added to info.plist

    <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>IPADDRESSWITHPORT</key> <dict> <key>NSExceptionMinimumTLSVersion</key> <string>TLSv1.0</string> <key>NSExceptionRequiresForwardSecrecy</key> <false/> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> </dict> </dict> </dict>
    rejected again.

// I think i should not add ip address.Domain name should be added.In that case what should i do?

And also i read configuring MAC to test ipv6 wont help actually coz the ipv6 will be converted to ipv4 while connecting to network.So thats the only thing i didnt tried.

Am struck for almost one month.I want to update the application,as the current prod app wont work.Help me!!!!!.Thanks in advance.


  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    You need to test with your Mac. Don't worry about the conversions going on. That's supposed to happen. What needs to work is for your app to use IPv6 when on an IPv6 network, which is what the Mac configuration does.

    As long as you use NSUrlSession and specify a domain name, NOT an IP address, it should "just work".

  • kavikumar.9960kavikumar.9960 USMember
    edited January 2017

    @DaveHunt Thanks for your reply bro.Today i tried the mac configuration.Its not working.If i want to add domain what should i do?As i was given webservice with ip literals.So i should request this from server side?

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    The best solution would be to request the domain name for the server.

    Alternatively, you can try using Dns.GetHostEntry and, if one of the addresses returned is an IPv6 address, use it, otherwise use the IPv4 address. This will only work if the IPv4 address is successfully resolved by the DNS.

  • kavikumar.9960kavikumar.9960 USMember
    edited January 2017

    @DaveHunt Yeah bro i already did that,Am i right?
    private string resolveIp(string ip){
    String ipv4 = "";
    IPHostEntry hostEntry = Dns.GetHostEntry(ip);

            foreach (IPAddress ipaAddress in host.AddressList)
                if (ipaAddress == AddressFamily.InterNetworkV6)
                    return "[" + ipaAddress()+"]";  // added "[","]" for ipv6
                else if (ipaAddress == AddressFamily.InterNetwork)
                    ipv4 = ipaAddress(); 
            return ipv4;

    and my url formation is

    string url = "http://"+resolveIp(IPV4)+":PORTNUMBER/mobileservice/service.asmx";

    Am getting error:400 Bad request error.

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    Have you verified that the resulting url looks correct?

    Also, I'm not sure that the httpIPv6 url format works across NAT64 (e.g. gets translated back to IPv4 outgoing). I would think it should, but I don't use it, so I can't say for sure. If it doesn't, then you may need to get the server folks to enable IPv6 on their end and be done with it.

  • kavikumar.9960kavikumar.9960 USMember
    edited January 2017

    @DaveHunt When i try to access the url from browser am getting "Invalid Hostname" error.Seems URL is wrong or the server is not accepting ipv6 address.

    BTW i tried with https:// also,Doest help.

    So am gonna try with server guys.

    Thank you so much bro for your replies.

Sign In or Register to comment.