Search Unity

Unity iOS and IPv6 support

Discussion in 'iOS and tvOS' started by Mantas-Puida, May 17, 2016.

  1. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @zzh1234567

    This should work with any Api Compatibility Level setting. Can you submit a bug report? We would love to take a look and correct the problem.

    Also, it is possible for you to provide the full managed call stack to the exception here? That might help us better understand the problem. Thanks!
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @SenaBlue

    Is it possible to get any other details from Apple about why the submission failed? We'll need to be able to reproduce the problem that caused the rejection locally in order to understand and correct it.
     
  3. lmdong6618

    lmdong6618

    Joined:
    Dec 30, 2015
    Posts:
    1
    @JoshPeterson
    Now i was using unity 4.68. I have some problems in apple verify . because .Net version is two low. in apple NAT64 Network environment GethosEntry() to analysis ipv6 address. the result is ipv4. and when create socket it occurred error. i search your official net. unity 5.35 has already support ipv6. but my app code from 4.x to 5.x changed too much. So could you help me to solve it assp. thank you.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @lmdong6618

    Please download the 4.7.2 release here:

    http://unity3d.com/get-unity/download/archive

    It is based on the 4.6 series, and it has all of the IPv6 fixes for iOS.
     
  5. zzh1234567

    zzh1234567

    Joined:
    Jun 15, 2016
    Posts:
    7

    my code :
    publicSocketStartNetWork(stringaddr, intport, intMaxtimeOut)
    {
    stringaddrRemote = addr;
    /****AddressFamilyaddressFamily= AddressFamily.InterNetwork;
    if((HaveLocalIP(AddressFamily.InterNetworkV6) == true))
    {
    addressFamily = AddressFamily.InterNetworkV6;
    addrRemote = "VR3DMMORPG.COM";
    }
    Debug.LogError("addressFamily ====" + addressFamily.ToString());
    Debug.LogError("addrRemote ====" + addrRemote.ToString());

    addrRemote = "VR3DMMORPG.COM";****/
    try
    {
    IPHostEntryipHostInfo = Dns.GetHostEntry(addrRemote)/*Dns.Resolve(addrRemote)*/;

    //EvaluatethesocketandreceivinghostIPAddressandIPEndPoint.
    for (intindex=0; index<ipHostInfo.AddressList.Length; index++)
    {
    //stablishtheremoteendpointforthesocket.
    Debug.LogError("index ====" + index.ToString());
    Debug.LogError("addrRemote ====" + addrRemote.ToString());
    IPAddressipAddress = ipHostInfo.AddressList[index];
    Debug.LogError("IPAddress ====" +ipAddress.ToString());
    Debug.LogError("AddressFamily ====" +ipAddress.AddressFamily.ToString());
    IPEndPointremoteEP = newIPEndPoint(ipAddress, port); //// ArgumentOutOfRangeException
    Debug.LogError("remoteEP ====" +remoteEP.ToString());
    //CreateaTCP/IPsocket. 使用指定的地址族、套接字类型和协议初始化Socket类的新实例
    //// SocketException
    Socketsocket = newSocket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
    if(socket == null)
    continue;


    //// 异步
    connectDone.Reset(); //// 将事件状态设置为非终止状态,导致线程阻止。

    //Connecttotheremoteendpoint.开始一个对远程主机连接的异步请求。
    socket.BeginConnect(remoteEP, newAsyncCallback(ConnectCallback), socket);


    //// 如果想要在调用BeginConnect方法后使原始线程阻止,请使用WaitOne //timeout
    if (true == connectDone.WaitOne( /*System.Threading.Timeout.Infinite*/MaxtimeOut, false ))
    {
    //// 当前实例收到信号
    if (IsConnectionSuccessfull)
    {//连线成功
    NetStatus = NETMANAGER_STATUS.CONNECT_SUCESS;
    //回调函数
    NetStatusChange(NetStatus);

    WriteFiles.WritFile.Log(LogerType.INFO, "Connection is Successfull");
    returnsocket;
    }
    }

    }
    }
    catch(SocketExceptione)
    {
    Console.WriteLine("SocketException caught!!!");
    Console.WriteLine("Source : " + e.Source);
    Console.WriteLine("Message : " + e.Message);
    }
    catch(ArgumentNullExceptione)
    {
    Console.WriteLine("ArgumentNullException caught!!!");
    Console.WriteLine("Source : " + e.Source);
    Console.WriteLine("Message : " + e.Message);
    }
    catch(NullReferenceExceptione)
    {
    Console.WriteLine("NullReferenceException caught!!!");
    Console.WriteLine("Source : " + e.Source);
    Console.WriteLine("Message : " + e.Message);
    }
    catch(Exceptione)
    {
    Console.WriteLine("Exception caught!!!");
    Console.WriteLine("Source : " + e.Source);
    Console.WriteLine("Message : " + e.Message);
    }

    NetStatus = NETMANAGER_STATUS.CONNECT_FAILED_CONNECT_ERROR;
    //回调函数
    NetStatusChange(NetStatus);

    ErrorString = "连接失败";////e.ToString();
    ////WriteFiles.WritFile.Log(LogerType.ERROR, e.ToString());
    WriteFiles.WritFile.Log(LogerType.ERROR, ErrorString);
    CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "连接服务器没有成功,请重试");
    returnnull;
    }

    ////////////////////////
    Console output:

    index ====0

    Network.NetObjManager:ConnectToServer(String, Int32)

    PROCEDURE.GamePro_Login:Tick()

    PROCEDURE.GameProcedure:TickActive()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)


    addrRemote ====VR3DMMORPG.COM

    Network.NetObjManager:ConnectToServer(String, Int32)

    PROCEDURE.GamePro_Login:Tick()

    PROCEDURE.GameProcedure:TickActive()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)


    IPAddress ====64:ff9b::739f:7eb8

    Network.NetObjManager:ConnectToServer(String, Int32)

    PROCEDURE.GamePro_Login:Tick()

    PROCEDURE.GameProcedure:TickActive()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)


    AddressFamily ====InterNetworkV6

    Network.NetObjManager:ConnectToServer(String, Int32)

    PROCEDURE.GamePro_Login:Tick()

    PROCEDURE.GameProcedure:TickActive()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)


    remoteEP ====64:ff9b::739f:7eb8:11189

    Network.NetObjManager:ConnectToServer(String, Int32)

    PROCEDURE.GamePro_Login:Tick()

    PROCEDURE.GameProcedure:TickActive()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)


    [06/16/2016 09:18:22]:ConnectCallback: System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used

    at System.Collections.Specialized.ListDictionary+DictionaryNodeEnumerator.MoveNext () [0x00000] in <filename unknown>:0

    at System.Net.Sockets.Socket.get_RemoteEndPoint () [0x00000] in <filename unknown>:0

    at Network.NetWork.ConnectCallback (IAsyncResult ar) [0x00000] in <filename unknown>:0

    at System.Net.Sockets.Socket+SocketAsyncResult.Complete () [0x00000] in <filename unknown>:0

    at System.Net.Sockets.Socket+Worker.Connect () [0x00000] in <filename unknown>:0


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)


    [06/16/2016 09:18:22]:连接失败

    Network.NetWork:ConnectToServer(String, Int32, Int32)

    Network.NetObjManager:ConnectToServer(String, Int32)

    PROCEDURE.GamePro_Login:Tick()

    PROCEDURE.GameProcedure:TickActive()
     
  6. zzh1234567

    zzh1234567

    Joined:
    Jun 15, 2016
    Posts:
    7
    @JoshPeterson
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @zzh1234567

    Thanks for the information. This is an issue we've seen before, and we have a fix ready for it. I'll let you know when the new 4.7.2 build with the fix is available.

    In the mean time, you might be able to work around it. The problem occurs with the LocalEndPoint and RemoteEndPoint implementations. So if you can avoid those, then it should not happen.
     
  8. zzh1234567

    zzh1234567

    Joined:
    Jun 15, 2016
    Posts:
    7
    so bad....

    so I cant deliver our binary to apple review.
     
  9. 7981

    7981

    Joined:
    Feb 16, 2014
    Posts:
    2
    unity4.7.2 / IOS9.0

    the connection to the domain address

    The "No Such host is Known (11001)" Error has occurred in the IPv6 environment

    In the IPv4 environment it is properly connected

    IPV6 is the difference between working for this need?
     
  10. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @zzh1234567

    If you cannot work around the problem, we'll let you know when the new 4.7 build which corrects the LocalEndPoint and RemoteEndPoint issue is available. It should be soon.
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @7981

    There could be a number of different issues involved with this error. Can you provide the full call stack for the exception? That might help us narrow down the cause. Also, does the host you are connected to actually have a valid IPv6 address? Thanks.
     
  13. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @Nicolas1212

    Thanks, we will look at that bug report soon. To clarify, are you seeing this on an iOS device or on an Android device? Also, we fixed an issue that looked similar a little while ago. In that case the machine.config XML file was incorrectly disabling IPv6. It may be easy to take a quick look for the machine.config file in the player build package and inspect its contents. Look for the string "ipv6" in that file. If it is not enabled, you can manually enable it by modifying that file.
     
  14. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    sorry jumping in here... is this a specific use case or would all iOS builds made with Unity 4.7.2 fail to pass App review?
     
  15. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @sfjohansson

    This is a specific case. A call to the LocalEndPoint or RemoteEndPoint properties of the .NET Socket object will through an exception in a IPv6-only network at version 4.7.2. Other parts of the .NET Socket API are working correctly.
     
    sfjohansson likes this.
  16. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    To clarify, are you seeing this on an iOS device or on an Android device?

    @JoshPeterson
    When we originally built it, IPv6 was working on iOS, but always crashed on Android, until we made the switch to .Net 2.0 Subset. iOS was crashing whenever we tried to access the RemoteEndPoint, but that's been fixed with the last patch (5.3.5p4).

    Generally though, there's a lot of inconsistencies between .Net 2.0 and the Subset, and even whether you do a direct Connect (using TcpClient) or an async connect. The test case submitted with the bug report goes through a number of types of connections.

    When testing, we came across a number of IPv6 bugs in Android (https://fogbugz.unity3d.com/default.asp?803613_bnc234pfm7rrvtg7 and https://fogbugz.unity3d.com/default.asp?803576_dd4igthvr1jva96j). As far as I know they're being looked at.

    It may be easy to take a quick look for the machine.config file in the player build package and inspect its contents.

    Where can I find this file?

    Thanks
     
  17. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @Nicolas1212

    Thanks for the information. It does seem that those bugs are under investigation by our Android team now. The location of the machine.config might vary depending on the platform. On Android it will be in the .apk file, although I'm not sure where. Note that that machine.config file is not necessary. If it does not exist, the Mono class library Socket implementation will ignore its absence and query the OS for IPv6 support, which should indicate that it is supported.
     
    Nicolas1212 likes this.
  18. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Where can I find this file?

    OK, I found it, and it's set to true:

    <settings>
    <ipv6 enabled="true"/>
    </settings>


    Our big problem at the minute is that we can connect through IPv6 using the setup mentioned here: https://developer.apple.com/library...tml#//apple_ref/doc/uid/TP40010220-CH213-SW16, but it's failing validation when Apple test it (we don't any info other than that).

    We're creating the TcpClient like this:

    new TcpClient( AddressFamily.InterNetworkV6 );​

    Aside from that, and making sure that the address you pass is IPv6 compliant, there's nothing else to change, right?

    Thanks
     
  19. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @Nicolas1212

    Ok, so it looks like this is not a problem with the machine.config file, as it has IPv6 enabled, as expected.

    You are using TcpClient correctly, so I'm not sure what else you can do. Is it possible to get more information about why the validation is failing from Apple?
     
  20. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    You are using TcpClient correctly, so I'm not sure what else you can do. Is it possible to get more information about why the validation is failing from Apple?

    @JoshPeterson

    Well that's something :)

    So far they're not responding to any of our questions or clarifications on their testing environment, which is more than frustrating. I've also opened a request for technical assistance but they're all off to WWDC. I think today is when they start re-answering mails, so hopefully we'll get more insight.

    We had debug logs activated for the duration, but they're not getting through. Our current attempt is to try and embed some info in the screenshot that they send. We'll see how that goes.
     
  21. codebleed

    codebleed

    Joined:
    Jun 20, 2016
    Posts:
    3
    I am currently working on the IPv6 support for our game, and I found an IPEndPoint issue when switched the backend to IL2CPP. Here is the detail of this issue.

    For testing IPv6, I setup a simple UDP client in Unity. This client will send a message to the server, the server respond a message back to client. The client should receive a message from the same server with exactly the same IPEndPoint. This works fine if I use mono, and works well with IL2CPP without IPv6. But if I switched to IL2CPP and use IPv6, the client received message from different IPEndPoint.

    The remoteEP got from UdpClient.Receive(ref remoteEP) should be the same, but it got some randomly remoteEP and will changed in subsequence calls. It only happened when I use IL2CPP and IPv6. This different behavior will break our code.

    Here is test code

    private IEnumerator StartUdpClient(string serverIP)
    {

    var serverAddress = IPAddress.Parse(serverIP);
    var serverEP = newIPEndPoint(serverAddress, 11000);

    var udpClient = newUdpClient(11000, serverAddress.AddressFamily);
    Debug.LogFormat("Create UDP client. localEP={0}, serverEP={1}", udpClient.Client.LocalEndPoint, serverEP);

    for (inti = 0; i < 10; i++)
    {
    // send data to server
    byte[] msg = Encoding.ASCII.GetBytes("Test message");
    udpClient.Send(msg, msg.Length, serverEP);

    // receive data from server
    var remoteEP = newIPEndPoint(serverAddress.AddressFamily == AddressFamily.InterNetworkV6 ? IPAddress.IPv6Any : IPAddress.Any, 0);
    msg = udpClient.Receive(ref remoteEP);
    Debug.LogFormat("Get data from server. remoteEP={0}", remoteEP);

    // remoteEP should be the serverEP, but it failed in IL2CPP and IPv6
    Assert.AreEqual(serverEP, remoteEP);

    yield return new WaitForSeconds(1);​
    }


    udpClient.Close();
    Debug.LogFormat("Shutdown UDP client.");​
    }

    Here is the output with Unity 5.3.5p4, Xcode 7.3.1, iOS 9.3.2

    mono backend with IPv6:
    Create UDP client. localEP=:::11000, serverEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=64:ff9b::a00:d2:11000
    Shutdown UDP client.



    IL2CPP with IPv6:
    Create UDP client. localEP=:::0, serverEP=64:ff9b::a00:d2:11000
    Get data from server. remoteEP=0:64:ff9b::a00%53760:27723
    Get data from server. remoteEP=0:64:ff9b::a00%53760:0
    Get data from server. remoteEP=2625:64:ff9b::a00%53760:0
    Get data from server. remoteEP=2626:64:ff9b::a00%53760:47404
    Get data from server. remoteEP=2627:64:ff9b::a00%53760:47404
    Get data from server. remoteEP=0:64:ff9b::a00%53760:0
    Get data from server. remoteEP=2629:64:ff9b::a00%53760:0
    Get data from server. remoteEP=2e2a:64:ff9b::a00%53760:47404
    Get data from server. remoteEP=372b:64:ff9b::a00%53760:0
    Get data from server. remoteEP=372c:64:ff9b::a00%53760:47404
    Shutdown UDP client.
     
    Last edited: Jun 21, 2016
  22. SenaBlue

    SenaBlue

    Joined:
    Jun 16, 2016
    Posts:
    3
    Hi!
    Thanks for watching!

    Query to Apple, but was confirmed by the procedure here has instructed, please submit again, only there was no reply.
    About three weeks, has continued to similar, such as exchange, but there is no sign that is still improving.

    Against Apple, but have a current technical inquiry does not have any reply yet.
    WWW class of Unity are probably controlled by CFNetwork, it should not have been included in the method that should not be the use of this time.
    Cause I do not know at all.
    Here is the strike means What no other?

    Thank you.
     
    Last edited: Jun 22, 2016
  23. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @superillbleed

    This is not something we have seen before. Can you submit a test project in a bug report that include both the client and the server code? That will help us track down the cause of this issue.
     
  24. codebleed

    codebleed

    Joined:
    Jun 20, 2016
    Posts:
    3
    I submitted a bug report. Case id 807653
     
    Nicolas1212 likes this.
  25. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @superillbleed

    Excellent, thanks! We will investigate this bug report.
     
  26. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    You are using TcpClient correctly, so I'm not sure what else you can do. Is it possible to get more information about why the validation is failing from Apple?

    @JoshPeterson

    Okay, our app just passed validation! Unfortunately, the debug info was timed (so we didn't have it in a general release) and we didn't get any info, but what happened:
    • Apple tested our app and were unable to connect to our servers via IPv6
    • They asked a fellow engineer to get in touch with us to explain what's going on. We're based in France, so the engineer they asked spoke French
    • Before getting in touch with us, the engineer decided to also test the game, and with the same version, same internal network, same iPad version...it worked
    • He rang us to explain what was going on - they're going to try and figure out what's going on internally - and did some tests with the app to make sure it passed normal validation, before releasing it
    So there does seem to be something going on internally with their networks, and I'd suggest trying to get in touch with Apple to see if you can get talking with an engineer who can test it. YMMV.

    Another thing to try is, when you submit your app for review, also submit a video showing the app running through the NAT64 setup and connecting properly.

    Note that as part of the $99 fee every year, you get two requests for technical assistance for free
     
  27. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @Nicolas1212

    I'm glad you were able to sort this out!
     
  28. tatata

    tatata

    Joined:
    Jul 11, 2013
    Posts:
    12
    Combining with "64:ff9b::" is not recomended.

    An apple staff said

    > it is not safe to form an IPv6 address by combining an IPv4 address with the Well-Known Prefix (64:ff9b::/96). This may work in some NAT64 networks but it is not a general solution to the problem.

    see #4 of https://forums.developer.apple.com/thread/46545

    EDIT:
    Are you planning to add a safe way to synthesise an IPv6 address from an IPv4 address?
    Thanks.
     
    Last edited: Jun 24, 2016
  29. codebleed

    codebleed

    Joined:
    Jun 20, 2016
    Posts:
    3
    Here is my implementation for resolve an IPv4 address:

    string ipString = NetworkUtility.ResolveIPv4Address("10.0.0.1");

    This function resolve IPv4 address based on current network. If current network is IPv4 only, the original IPv4 address will return. e.g. "10.0.0.1". If current network is IPv6 only, a synthesized IPv6 address will return. e.g. "64:ff9b::a00:d2"

    The c code is based on the example from Apple and I added a C# wrapper for easy use.
    To use the code, just extract the attached zip file. Put NetworkUtility.c to Assets\Plugins\iOS folder and NetworkUtility.cs to Scripts folder.
     

    Attached Files:

    Last edited: Jun 24, 2016
    rbrt likes this.
  30. SenaBlue

    SenaBlue

    Joined:
    Jun 16, 2016
    Posts:
    3
    hi!

    I was able to successfully resolve.
    It seems there was a problem here of infrastructure.
    Depending on the environment, or can be connected, there is a problem or could not.

    Thank you.
     
  31. BornGamer92

    BornGamer92

    Joined:
    Jul 31, 2016
    Posts:
    1
    Hi Everyone!

    First off i am new to Unity and publishing apps on Apple app store.

    We are having an issue when publishing our app on iOS that i have no idea why it is occurring and i have no way of testing it. Our ISP does not provide IPv6 support so i don't have a way to even reproduce this error.

    Here is the rejecting message from Apple

    "We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.3.3 on Wi-Fi connected to an IPv6 network.

    Specifically, we attempted to login with the demo credentials however the login alert did not go away and the app presented no further content.

    The steps to reproduce are:

    1. Launch the app
    2. Input user credentials
    3. Tap login
    4. Message states "Login Successful" however no further action is presented

    We've attached screenshot(s) for your reference."

    I am using a simple wwwform call to get a response json. Here is my code for it.

    public IEnumerator LoginUser(){
    var UEmail = Email.text;
    var UPass = Password.text;
    WWWForm form = new WWWForm ();
    form.AddField ("email", UEmail);
    form.AddField ("password", UPass);

    WWW SendForm = new WWW (login_URL, form);

    yield return SendForm;
    if (!string.IsNullOrEmpty (SendForm.error)) {
    Message.text = "Login Failed";
    yield return new WaitForSeconds (0.5f);
    MessageModel.gameObject.SetActive (false);
    } else {
    Debug.Log (SendForm.text);

    JSONObject j = new JSONObject (SendForm.text);
    if (j[0] == null ) {
    Message.text = "Login Failed. Please Try Again!";
    yield return new WaitForSeconds (0.5f);
    MessageModel.gameObject.SetActive (false);
    } else {
    Message.text = "Login Successful";
    PlayerPrefs.SetString("Email",j[0].GetField("email").str);
    PlayerPrefs.SetInt ("HighScore",int.Parse( j[0].GetField("highest_score").str));
    PlayerPrefs.Save ();
    yield return new WaitForSeconds (0.5f);
    MessageModel.gameObject.SetActive (false);
    Manager.OpenPanel (PlayAnim);
    }
    }
    }
    }

    it works fine on Web, Android and even on iOS on IPv4, but for some reason not on IPv6.

    My URL is https supported.
    Scripting Backend: IL2CPP
    Target minimum iOS Version: 8.0
    Api Compatibility Level: .NET 2.0 Subset

    Any kind help is much appreciated.
     

    Attached Files:

  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @BornGamer92

    Even without an IPv6 network from your ISP, you should be able to create a local IPv6 network to test the app using this information: https://developer.apple.com/library...standingandPreparingfortheIPv6Transition.html

    This is the same way that Apple tests apps for submission, so hopefully it will allow you to reproduce the problem.

    Based on the code you provided, the only possible problem I see it the login_URL variable. Is that an IPv4 address? If so, it won't work with IPv6. You may want to use a hostname instead.
     
  33. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    Hello,

    I'm running into this issue myself. I'm using Unity 5.4.0f3 and Xcode 7.3. My project doesn't contain anything related to web except from plugins like Google Services, Facebook and Push Notification.

    I checked Apple doc, and looked for the Check Source Code for IPv6 DNS64/NAT64 Incompatibilities but didn't find anything (I'm not sure, if a simple Xcode search is enough).

    is there anything to check for a Unity project? Does Xcode or even Unity need special settings?
     
  34. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Did you test your app in NAT64 environment locally? (Like suggested in "Test for IPv6 DNS64/NAT64 Compatibility Regularly" section in Apple doc)
     
  35. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    Hi Mantas, thanks for the quick answer!

    Yes, I tried, the logs are in attachement. Nothing seems to be wrong, I didn't have a crash when launching my game.
     

    Attached Files:

    • logs.txt
      File size:
      11.3 KB
      Views:
      1,226
  36. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    What exactly smae issue do you have? Was your app rejected by Apple?
     
  37. -Aymeric-

    -Aymeric-

    Joined:
    Oct 21, 2014
    Posts:
    110
    Yes, it was rejected by Apple:
    We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.

    Next Steps

    Please revise your app and test it on a device while connected to an IPv6 network (all apps must support IPv6) to ensure it will launch without crashing.

    They added two files (in attachements) but I can't find clue there.
     

    Attached Files:

  38. jiangPeng206

    jiangPeng206

    Joined:
    Jan 18, 2017
    Posts:
    2
    i use unity 4.7.2,
    WebRequest request = WebRequest.Create(url);
    in mono , it's can run ok
    but appstore refuse

    We discovered one or more bugs in your app when reviewed on iPhone running iOS 10.2 on Wi-Fi connected to an IPv6 network.

    Specifically, an error message still displays when app downloads upon launch.

    We've attached screenshot(s) for your reference.

    Next Steps

    Please run your app on a device while connected to an IPv6 network (all apps must support IPv6) to identify the issue(s), then revise and resubmit your app for review.

    If we misunderstood the intended behavior of your app, please reply to this message in Resolution Center to provide information on how these features were intended to work.

    For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce the issue(s). For updates, install the new version as an update to the previous version, then follow the steps to reproduce the issue(s)

    what problem ????????
     
  39. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @jiangPeng206

    Unity at 4.7.2 does not have full IPv6 support. I would recommend trying a newer version of Unity, where IPv6 support is complete for iOS.
     
  40. FadiGames

    FadiGames

    Joined:
    Jul 23, 2015
    Posts:
    15
    Hi, I want to ask if the IPv6 support in Unity 5.5.1 personal edition is working or broken? I am facing problems with the App store after I updated my unity version.
     
  41. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @fadoosher

    Yes, IPv6 support for iOS should be working fine in this version of Unity. We've not had any IPv6-related bug reports recently. However, if you have found a problem, please do submit a bug report. We will correct it.
     
  42. FadiGames

    FadiGames

    Joined:
    Jul 23, 2015
    Posts:
    15
    Well, since you didn't get IPv6-related bug reports, it seems this Unity version is fine, let me dig more into this, thanks :)
     
  43. rohitdisney16

    rohitdisney16

    Joined:
    Feb 9, 2017
    Posts:
    1
    Hi

    As Apple has rejected our build due to no support for IPv6.


    we are using following version of unity3d.
    Version 4.7.2f1 (a7fe7b7f3d1f)
    Tue, 24 May 2016 20:50:05 GMT
    Branch: release/4.6/release

    attached the crash log from apple.


    Kindly please help us on this and also let me know is there any updated patch available.
     

    Attached Files:

  44. Mareck

    Mareck

    Joined:
    Aug 13, 2014
    Posts:
    77
    Same problem here. An update of my (previously by Apple accepted) app suddenly gets rejected by Apple because of no ipv6 support (I have done no updates to the network code since the last release that was accepted). After some digging it seems that the code I used to detect whether the device is on a network that supports ipv4 or ipv6 and return a ipv4 or ipv6 ip no longer works with Unity 5.4.4

    The method I was using was:

    Code (CSharp):
    1.  
    2.         var deviceAddress = Dns.GetHostEntry(Dns.GetHostName());
    3.  
    4.         var ipv4 = false;
    5.         var ipv6 = false;
    6.  
    7.         foreach (var ip in deviceAddress.AddressList) {
    8.             if (ip.AddressFamily == AddressFamily.InterNetwork) ipv4 = true;
    9.             if (ip.AddressFamily == AddressFamily.InterNetworkV6) ipv6 = true;
    10.         }
    11.  
    If ipv4 is false then we assume that the network we are on is not ipv4 enabled. In that case we pick a AddressFamily.InterNetworkV6 from the host array.

    Code (csharp):
    1.  
    2.         IPHostEntry host = Dns.GetHostEntry(address);
    3.         foreach (IPAddress ip in host.AddressList) {
    4.             if (ip.AddressFamily == AddressFamily.InterNetworkV6) {
    5.                 return ip;
    6.             }
    7.         }
    8.  
    Edit: I can't reproduce this with older versions of Unity on Windows 10 in the editor. Regardless whether I am on a ipv6 only network or a 4 and 6 network the ipv4 ips get returned by Dns.GetHostEntry.

    Since I have had 2 releases that were approved with this code since October either Apple was not checking ipv6 requirements in that time period, or something else is different now that has changed the behavior.
     
    Last edited: Feb 14, 2017
  45. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Can you reproduce this issue locally on iOS in IPv6-only environment?

    P.S. IPv6 rejection notice is default message Apple sends in case something doesn't work, so it might be actually different issue.
     
  46. Mareck

    Mareck

    Joined:
    Aug 13, 2014
    Posts:
    77
    Not sure if everything works fine. I can't do the ipv6 test as recommended by Apple (using a shared ipv6 only network) since I am not usiong a real mac but one on a vm at the moment. I'll just force the app to try ipv6 if connecting through ipv4 failed for whatever reason.
     
    Last edited: Feb 15, 2017
  47. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Same problem here.
    Unity 5.5.1.p4 in OSX 10.12.3 (Sierra)
    We were unable to complete our review of your app as it crashed on launch. Your app was reviewed on iPhone running iOS 10.2.1 connected to an IPv6 network.
     
    MrEsquire likes this.
  48. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Did you test it locally in NAT64 (IPv6-only network)?
     
  49. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    IndieFist likes this.
  50. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    I have to test it.
    But i cannot understood why two apps made it with same engine and same version.
    One was rejected and the other one was published .