title: Xamarin iOS IPv6 App Store Rejection
body: <p>We have been building a iOS app that is about Client - Server App.
  We are using an SQL connection and WCF web services in the iOS app with Xamarin.</p>
  
  <p>SQL Connection Code : </p>
  
  <pre><code>    String ips = "10.0.0.1" ; //Example.
    SqlConnection con =   new SqlConnection(@"Data Source=" + ips + "; initial Catalog="x";user id =y;password = z;");
  </code></pre>
  
  <p>Apple decided to use only ipv6 on iOS9, so they published a document about IPv6 compatibility - <a href="https://developer.apple.com/library/tvos/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html" rel="nofollow">IPv6 Documentation</a></p>
  
  <p>Xamarin published a blog post about this too - <a href="https://blog.xamarin.com/making-your-ios-apps-ipv6-ready?utm_content=buffer628cf&amp;utm_medium=social&amp;utm_source=twitter.com&amp;utm_campaign=buffer" rel="nofollow">Making Your iOS Apps IPv6 Ready</a></p>
  
  <p>I read all those documents, but I could not manage to get rid of this "Store Rejection" problem. </p>
  
  <p>I want to show you my last attemp : <strong>(ipv4 to ipv6)</strong></p>
  
  <pre><code>string input = "10.0.0.1";
              string ips = "";
              IPAddress address;
              if (IPAddress.TryParse(deviceIP, out address))
              {
                  switch (address.AddressFamily)
                  {
                      case System.Net.Sockets.AddressFamily.InterNetwork:
                          // we have IPv4
                          ips = input;
                          break;
                      case System.Net.Sockets.AddressFamily.InterNetworkV6:
                          // we have IPv6
                          IPAddress ip = IPAddress.Parse(input).MapToIPv6();
                          ips = "[" + ip.ToString() + "]";
                          break;
                      default:
                          //
                          break;
                  }
              }
  </code></pre>
  
  <p>I used the <code>MapToIPv6()</code> function as described in the Xamarin blog post, but again my app was rejected by Apple.</p>
  
  <p>Our app works well on IPv4 (Apple says this too). When Apple engineers turn off ipv4 and only use ipv6, our app could not reach the host.</p>
  
  <p>Please help me to resolve this problem. </p>
  
  <p>Platform : Visual Studio 2015 with Xamarin on Windows 10 + Mac OS X El-Capitan</p>
  
  <p>Server : ON IPv4 Only. </p>