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

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

问题描述

我们一直在构建一个关于客户端 - 服务器应用程序的 iOS 应用程序.我们在带有 Xamarin 的 iOS 应用中使用 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;
                }
            }

我使用了 Xamarin 博客文章中描述的 MapToIPv6() 函数,但我的应用程序再次被 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 El-Capitan 上带有 Xamarin 的 Visual Studio 2015

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

服务器:仅启用 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;
    }
}

要亲自查看,您可以查看 参考来源.从那里你可以看到在你的例子中 AddressFamilyInterNetworkV6 所以 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天全站免登陆