Xamarin iOS IPv6 App Store拒绝 [英] Xamarin iOS IPv6 App Store Rejection

查看:127
本文介绍了Xamarin iOS IPv6 App Store拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直在构建一个关于客户端 - 服务器应用程序的iOS应用程序。
我们在iOS应用程序中使用Xamarin使用SQL连接和WCF Web服务。

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.

SQL连接代码:

    String ips = "10.0.0.1" ; //Example.
  SqlConnection con =   new SqlConnection(@"Data Source=" + ips + "; initial Catalog="x";user id =y;password = z;");

Apple决定在iOS9上只使用ipv6,因此他们发布了一个关于IPv6兼容性的文档 - IPv6的

Apple decided to use only ipv6 on iOS9, so they published a document about IPv6 compatibility - IPv6 Documentation

Xamarin也发表了一篇关于此事的博客文章 - 让你的iOS应用程序支持IPv6

Xamarin published a blog post about this too - Making Your iOS Apps IPv6 Ready

我读了所有这些文件,但是我无法摆脱这种商店拒绝问题。

I read all those documents, but I could not manage to get rid of this "Store Rejection" problem.

我想告诉你我的最后一次尝试:(ipv4 to ipv6)

I want to show you my last attemp : (ipv4 to ipv6)

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;
                }
            }

我使用 MapToIPv6( )函数如Xamarin博客文章中所述,但我的应用程序再次被Apple拒绝。

I used the MapToIPv6() function as described in the Xamarin blog post, but again my app was rejected by Apple.

我们的应用程序在IPv4上运行良好(Apple表示这个也是)。当Apple工程师关闭ipv4并仅使用ipv6时,我们的应用程序无法访问主机。

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.

请帮我解决此问题。

平台:在Windows 10 + Mac OS X上使用Xamarin的Visual Studio 2015 El-Capitan

Platform : Visual Studio 2015 with Xamarin on Windows 10 + Mac OS X El-Capitan

服务器:ON仅限IPv4。

Server : ON IPv4 Only.

推荐答案

评论中已经有一些有用的东西,但我认为你的主要问题是你有IPv4到IPv6的映射另一种方式。您原来是保留IPv4地址并将IPv6地址映射到已经存在的IPv6。

There's already some helpful stuff in the comments, but I think that your main problem is that you had the IPv4 to IPv6 mapping the other way around. You were leaving the IPv4 address as it was and mapping the IPv6 address to IPv6 which it already was.

查看固定版本:

string input = "10.0.0.0";
string ips = "";
IPAddress address;
if (IPAddress.TryParse(input, out address))
{
    switch (address.AddressFamily)
    {
        case System.Net.Sockets.AddressFamily.InterNetwork:
            // we have IPv4, map it to IPv6
            IPAddress ip = IPAddress.Parse(input).MapToIPv6();
            ips = ip.ToString();
            break;
        case System.Net.Sockets.AddressFamily.InterNetworkV6:
            // we have IPv6, leave it as is
            ips = input;
            break;
    }
}

为了亲眼看看,你可以看看参考资料来源。从那里你可以看到,在你的例子中, AddressFamily InterNetworkV6 所以 MapToIPv6 方法只返回 IPAddress ,因为没有什么可以改变的。

To see for yourself, you can take a look at the Reference Source. From there you see that in your example the AddressFamily was InterNetworkV6 so the MapToIPv6 method just returns the IPAddress unchanged because there's nothing to change.

public IPAddress MapToIPv6()
{
    if (AddressFamily == AddressFamily.InterNetworkV6)
    {
        return this;
    }

    // ...
}

这篇关于Xamarin iOS IPv6 App Store拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆