Forum Xamarin.Forms

App Store Rejected - Wi-Fi connected to an IPv6 network

Hi guys,

I have a problem, Im trying to publish my app on app store(apple), but it is being rejected.

We discovered one or more bugs in your app when reviewed on iPhone running iOS 9.3.4 on Wi-Fi connected to an IPv6 network.
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.
_

I know that aple started enforcing a new policy whereby all iOS applications must support IPv6-only network services in iOS 9. While Apple states that most apps will not need to be changed or updated, your app may be using a few libraries that need to be updated before you submit your next update.

But im using httpclient to a server with no hard coded IP.. and i have this problem now..

Do you guys know how to help me?
Is it a Xamarin Bug?

Im using HttpClient

string uri = "https://example.azurewebistes.net/api/example"

HttpClient client = new HttpClient();
 var response = await client.GetAsync(uri);

Relevant link
https://developer.apple.com/library/mac/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1
https://blog.xamarin.com/making-your-ios-apps-ipv6-ready/

__The print anexed is from app review

Xamarin.Forms version: 2.3.0.46

Tagged:

Best Answer

«1

Answers

  • DanielOkelyDanielOkely USMember

    I'm getting the same rejection notice too. I'm using WebRequest.CreateHttp

  • MarcoMacedoMarcoMacedo BRMember ✭✭

    Yea.. Really annoying!

    Any help please?
    I need to publish this app :/

  • JoshBailarJoshBailar USUniversity

    We are having the same issue, our App was rejected twice, and they said:

    "We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.3.4 on Wi-Fi connected to an IPv6 network. Specifically, your app still states that there is no internet connection on launch".

    We followed the test specified on Apple article about testing on IPv6 with DNS64/NAT64 compatibility, even using a IPv6 proxy, and our app works well. We can't reproduce the issue.

    Our Api is hosted in Azure, and we are using the Azure Mobile SDK to consume it. Additionally, we are using Xamarin.Forms to build the UI.

    The worst thing is that we can't reproduce it, so we do not have idea how to solve it.

  • TrevorCoxTrevorCox CAMember ✭✭
    edited August 2016

    We submitted about 20 apps with the same source code, 3 were rejected for this reason and the rest passed. We use modernhttpclient and generally don't do anything but regular HTTPS GET/POST.

    HOWEVER, just after I first posted this I realized we are using sample code from Xamarin that does use IPv4:

    https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs

    I've added an Issue: https://github.com/xamarin/monotouch-samples/issues/106

  • JohnyKamnangJohnyKamnang BEMember ✭✭

    I'm facing the same problem...

    My app just have an httpclient. no hardcoded ipaddres...

    :-(

  • RasmusBjergRasmusBjerg DKMember ✭✭

    My App was also rejected, i just updated Microsoft.Rest.ClientRuntime from 0.9.6 to 2.3.2 and it was accepted.

  • MarcoMacedoMarcoMacedo BRMember ✭✭

    I dont have this lib installed on my xamarin project..
    Microsoft.Rest.ClientRuntime

    Where do you use it ?

    Are you using HttpClient?

  • ChristianHoefleChristianHoefle USUniversity ✭✭

    @RasmusBjerg Do you use Azure to host your Web-Application?

  • MarcoMacedoMarcoMacedo BRMember ✭✭

    @ChristianHoefle said:
    @RasmusBjerg Do you use Azure to host your Web-Application?

    Yes man, i use Azure to host my server.

  • RasmusBjergRasmusBjerg DKMember ✭✭

    Yes i do, i use an App Service enviroment

  • JaimeBulaJaimeBula COMember
    edited August 2016

    Here is the problem.

    private bool IsNetworkAvailable(out NetworkReachabilityFlags flags)
            {
                if (defaultRouteReachability == null)
                {
                    **defaultRouteReachability = new NetworkReachability(new IPAddress(0));**
                    defaultRouteReachability.SetNotification(OnChange);
                    defaultRouteReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
                }
                if (!defaultRouteReachability.TryGetFlags(out flags))
                    return false;
                return IsReachableWithoutRequiringConnection(flags);
            }
    
            private bool IsAdHocWiFiNetworkAvailable(out NetworkReachabilityFlags flags)
            {
                if (adHocWiFiNetworkReachability == null)
                { 
                    **adHocWiFiNetworkReachability = new NetworkReachability(new IPAddress(new byte[] { 169, 254, 0, 0 }));**
                    adHocWiFiNetworkReachability.SetNotification(OnChange);
                    adHocWiFiNetworkReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
                }
    
                if (!adHocWiFiNetworkReachability.TryGetFlags(out flags))
                    return false;
    
                return IsReachableWithoutRequiringConnection(flags);
            }
    

    I'll change it to a Url to see how it evolves. Both NetworkReachability receive an IP v6 address. This code was taken from an availability recipe.

  • ShunsukeKawaiShunsukeKawai JPMember
    edited September 2016

    I got rejection with same reason yesterday.
    I am using System.Net.HttpWebRequest and Microsoft.Azure.Engagement.Xamarin.
    I tested again but I have not experienced the issue(s) that Apple discovered in the IPv6 network environment that I built with Apple official procedure.
    https://developer.apple.com/library/mac/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1

    I told them above and asked them re-examination, then it was accepted today,
    It depends on luck...?

  • MarcoMacedoMarcoMacedo BRMember ✭✭

    Same here..

    I changed nothing and apple approved my app now..

    I guess they are doing wrong on testes.. idk

  • ChristianHoefleChristianHoefle USUniversity ✭✭

    @MarcoMacedo So you pushed the same app again using Azure Mobile Services and HttpClient and it was approved? What the f*** is going on with Apple?

  • JoshBailarJoshBailar USUniversity

    Hello everyone, finally our app was approved. We are not sure what fixed the issue running our app over an IPv6 network because we could not reproduce it, but we updated our Azure Mobile Client SDK to the latest version, and we started using the ModernHttpClient (https://www.nuget.org/packages/modernhttpclient/) to use it as HttpClient handler.

  • TrevorCoxTrevorCox CAMember ✭✭

    Updating to the latest Connectivity plugin seems to have resolved the issue for us.

  • DavidS.4178DavidS.4178 USMember ✭✭

    Our app was rejected for the same reason, and we don't use the Connectivity plugin. We were able to repro this by starting the application when connected to an IPV4 network then switching to an IPV6 network without closing the app. After that, network requests made using HttpClient would fail. Interestingly, if the app starts connected to an IPV6 network, all seems fine; it's only switching from IPV4 to IPV6 that seems to have issues. We were also able to repro this on some (not all) other Xamarin apps in the app store so this seems to be a general issue.

    We switched the HttpClient stack to NSUrlSession (https://developer.xamarin.com/guides/cross-platform/macios/http-stack/) which resolved it on our end. We recently resubmitted to the app store so we will see if it is accepted to the app store now.

  • MarcoMacedoMarcoMacedo BRMember ✭✭

    @DavidS.4178 said:
    Our app was rejected for the same reason, and we don't use the Connectivity plugin. We were able to repro this by starting the application when connected to an IPV4 network then switching to an IPV6 network without closing the app. After that, network requests made using HttpClient would fail. Interestingly, if the app starts connected to an IPV6 network, all seems fine; it's only switching from IPV4 to IPV6 that seems to have issues. We were also able to repro this on some (not all) other Xamarin apps in the app store so this seems to be a general issue.

    We switched the HttpClient stack to NSUrlSession (https://developer.xamarin.com/guides/cross-platform/macios/http-stack/) which resolved it on our end. We recently resubmitted to the app store so we will see if it is accepted to the app store now.

    Tell us if they aproved or not =)

  • DavidS.4178DavidS.4178 USMember ✭✭

    @MarcoMacedo said:

    @DavidS.4178 said:
    Our app was rejected for the same reason, and we don't use the Connectivity plugin. We were able to repro this by starting the application when connected to an IPV4 network then switching to an IPV6 network without closing the app. After that, network requests made using HttpClient would fail. Interestingly, if the app starts connected to an IPV6 network, all seems fine; it's only switching from IPV4 to IPV6 that seems to have issues. We were also able to repro this on some (not all) other Xamarin apps in the app store so this seems to be a general issue.

    We switched the HttpClient stack to NSUrlSession (https://developer.xamarin.com/guides/cross-platform/macios/http-stack/) which resolved it on our end. We recently resubmitted to the app store so we will see if it is accepted to the app store now.

    Tell us if they aproved or not =)

    Approved today. :)

  • JakobDinesenJakobDinesen DKMember ✭✭

    My app was rejected for same reason.
    Can someone provide best solution to fix this issue asap?

  • MarcoMacedoMarcoMacedo BRMember ✭✭
    edited September 2016

    @JakobDinesen

    I just sent again, and they approved.. lol
    But you can see what @DavidS.4178 suggested.

  • BienDo.6540BienDo.6540 USMember ✭✭
    edited September 2016

    @Marco Macedo : I have issue same as you, I config as your tutorial, and I test app with network ipv6 but i have another error "A Server with the specified hostname could not be found.", I try access hostname url by safari and get error. Attachment file is setting of project
    Can you help me ? Thanks.

  • VinnieVivaceVinnieVivace NZMember ✭✭
    edited September 2016

    I also have this issue. Changing to NSUrlSession has not resolved. As outlined by others, when the initial connection is established as IPv4 and then switched to IPv6 causes the issue. i get the following error:

    Error getting response stream (ReadDone1): ReceiveFailure

    I am relying quite heavily on RestSharp... client not happy, not sure what to do.

    Any advice appreciated.

  • DH_HA1DH_HA1 USMember ✭✭✭

    @VinnieVivace this might work for you. https://github.com/FubarDevelopment/restsharp.portable/issues/34

    RestSharp doesn't use HttpClient under the covers

  • VinnieVivaceVinnieVivace NZMember ✭✭

    @DH_HA1 . Thank you very much. With a few hours of stuffing around, this did indeed resolve my issues, cheers.

  • NMuslayahNMuslayah AUMember

    Hi Guys,

    Looked at all the above and quite interesting - however I am still stuck and app has been rejected 3 times already. Initially used IP literals and since them modified to fully qualified domain name and still no luck.

    I am using Visual Studio 2015 / Xamarin to build the app.

    1) Reference the WCF service using SVCUtil
    2) Calling the Service using System.ServiceModel
    3) Using BasicHttpBinding as below.

    The below works fine on IPV4 networks and the server which is hosting the WCF is only IPV4 enabled.

    The more I think about it - i believe this is nothing more to change on the code but it is more towards the configuration of the domain name which is hosted by godaddy.

    At this stage, it is using the default nameservers of godaddy which i think does not allow for DNS64/NAT64 services.

    I have researched and found out that Google provides DNS64 services and tried to include them on the nameserver settings in godaddy - but godaddy for some reason keeps coming up with invalid address.

    I am also fully Windows Based and did not managed to do the DNS64/NAT64 test as advised by Apple unless I go an purchase a physical Mac - note, currently using an online Mac Instance from Macincloud to build my files.

    I have also tried to include the equivalent IPV6 address on the AAAA records on godaddy - but i think this is not the way to go since DNS64 should be the one doing that job and that domain should only have A records.

    I would appreciate if anyone could please help me to check whether this is actually a networking / domain problem or code level ?

    Thanks again all in advance.

    private static readonly EndpointAddress RacingEndPoint = new EndpointAddress("http://www.totelepep.com/mobi.svc");
    
        private static MobiClient GetServiceClient()
        {
            BasicHttpBinding binding = new BasicHttpBinding
            {
                Name = "basicHttpBinding",
                MaxBufferSize = 2147483647,
                MaxReceivedMessageSize = 2147483647
            };
    
            binding.ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas()
            {
                MaxArrayLength = 2147483646,
                MaxStringContentLength = 5242880,
            };
    
            TimeSpan timeout = new TimeSpan(0, 0, 30);
            binding.SendTimeout = timeout;
            binding.OpenTimeout = timeout;
            binding.ReceiveTimeout = timeout;
    
            MobiClient client = new MobiClient(binding, RacingEndPoint);
            return client;
        }
    
  • BienDo.6540BienDo.6540 USMember ✭✭

    @Marco Macedo : do you config webservices azure api ? I make same as your guide but it's not successfully.

  • dnzprmkszdnzprmksz TRMember ✭✭
    edited September 2016

    Hi everyone,

    I just had same issue today and after testing my app on a local IPv6 network, I easily reproduced the error and the app crashed. I resolved the issue but forgot to check what actually causes it :(

    Here are the steps I followed:

    • Updating Plugin.Connectivity to latest stable version.
    • Changing HttpClient implementation from Default to NSUrlSession. (In iOS Properties > iOS Build > Advanced)
    • Installing ModernHttpClient library from NuGet.
    • Updating my API URL from using HTTP to HTTPS. (Just could not use HTTP after the steps above, app threw exception)

    PS: My web app is deployed on Azure and I did not configure anything specifically for this.

    Hope that it will work for you, too!
    I will also update this message, when my app passes the App Store review :smile:

  • dnzprmkszdnzprmksz TRMember ✭✭

    Yeah my app passed the App Store review after these fixes. Hope someone will benefit :smile:

  • DanilDanil RUMember

    same problem. solution:

    if you use something like this in your project

    var address = "xx.xx.xx.xx";
    var client = new System.Net.Sockets.TcpClient(address);
    var result = client.BeginConnect(ipAddressClass, portNumber, null, null);
    

    change it to:

    var ipAddressClass = System.Net.IPAddress.Parse(ipAddress);
    var client = new System.Net.Sockets.TcpClient(ipAddressClass.AddressFamily);
    var result = client.BeginConnect(ipAddressClass, portNumber, null, null);
    
  • RickGRickG USMember

    How are you able to test on a local IPv6 network?

  • RickGRickG USMember
    edited February 2017

    Thanks!!! @VinnieVivace, my issue apple complained about is that my FB login page waits too long?!? but nevertheless, they gave me the error above.

    I did get the IPV6 network going and logging in with FB works for both "Managed" and "NSUrlSession" but I've always submitted the app with "Managed" soooooo

    I'm going to submit it a 3rd time with the recommended "NSUrlSession" setting noted above so stay tuned folks...Lets hope 3rd time is the charm.

  • RickGRickG USMember

    Apple rejected me again saying that FB just spins when clicking the "Continue as Fly" button over IPV6 on an iPad.

    Modifications I've made for the version they are testing are below so as per the research, these fixes should've fixed it:

    1. I updated to the latest Xam.Connectivity plugin which is supposed to fix the IPV6 issues
    2. I changed the HTTP in the IOS Options to use "NSURLSession" instead of the default
    3. Tested it and it passed - I created a local IPV6 network as per the link above using my ethernet & wi-fi to get it to work.
    4. I validated that NO IP Addresses are used in my app

    My testing as per the instructions above work properly but apple says they can't get past this page when they click the button.

    Perhaps the FB oauth url is not IPV6 ready? https://m.facebook.com/dialog/oauth/ I'm going to try w/o the "m".

    Let me know if anyone has gotten this far with all the fixes recommended and still got rejected and what did you do to fix this? Thanks

  • RickGRickG USMember
    edited February 2017

    I'm using xamarin auth for my FB login and they recomend using this code snippet below but when I do an IPV6 test on that "m." url using (http://ready.chair6.net/), it gives me a warning so maybe I need a different authorizeUrl for FB that is IPV6 compatible?

    using Xamarin.Auth;
    var auth = new OAuth2Authenticator (
    clientId: "App ID from https://developers.facebook.com/apps",
    scope: "",
    authorizeUrl: new Uri ("https://m.facebook.com/dialog/oauth/"),
    redirectUrl: new Uri ("http://www.facebook.com/connect/login_success.html"));

  • RickGRickG USMember

    I re-submitted & removed the "m" from Facebook url and I also tested the IPv6 as per their documentation and it all works fine. I took a video of the whole thing and if they reject my app again, I'll show them the video but at this point, I've changed what needs changing based on all your recommendations. Thanks!

  • RickGRickG USMember
    edited February 2017

    it finally passed, crazy...maybe the "m" in the facebook url fixed it, i really don't know but that was the last thing i changed before submitting for the last time.

    just a quick list of what i did
    1. changed to use NSURLSession
    2. updated the xamarin plugin for connectivity to the latest version
    3. in the xamarin auth section for connecting to FB, i changed to use "www" instead of "m"

  • brindhumanibrindhumani INMember
    edited July 2017

    hello friends , i am having same problem , because webservices i use does not support ipv6, but i want to upload to app store, is it possiple, plz help me

  • ElyfranVazElyfranVaz USMember ✭✭

    news?

Sign In or Register to comment.