Eric Chong
Eric Chong

Reputation: 505

running iOS 10.0 on Wi-Fi connected to an IPv6 network

Iphone app rejected because of the the reason that “We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 10.0 on Wi-Fi connected to an IPv6 network.” Anyone can help to solve it?

import UIKit
let useClosures = false

class ViewController: UIViewController {

    let reachability = Reachability.reachabilityForInternetConnection()

    @IBOutlet weak var WebView: UIWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.


        view.backgroundColor = UIColor.redColor()




        let URL = NSURL(string: "https://gph-shop.com/tracing")

        WebView.loadRequest(NSURLRequest(URL: URL!))

        if (useClosures) {
            reachability?.whenReachable = { reachability in
                print("Reachable")
            }
            reachability?.whenUnreachable = { reachability in
                print("Unreachable")
            }
        } else {
            NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ViewController.reachabilityChanged(_:)), name: ReachabilityChangedNotification, object: reachability)
        }

        reachability?.startNotifier()

        // Initial reachability check when the app starts
        if let reachability = reachability {
            dispatch_async(dispatch_get_main_queue()) {
                if reachability.isReachable() {
                    let alertController = UIAlertController(title: "", message: "wi-fi connected", preferredStyle: .Alert)
                    let defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)

                    alertController.addAction(defaultAction)

                    self.presentViewController(alertController, animated: true, completion: nil)
                } else {
                    let alertController = UIAlertController(title: "Alert", message: "Please connect to internet", preferredStyle: .Alert)
                    let defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)

                    alertController.addAction(defaultAction)

                    self.presentViewController(alertController, animated: true, completion: nil)
                }
            }
        }
    }

    deinit {

        reachability?.stopNotifier()

        if (!useClosures) {
            NSNotificationCenter.defaultCenter().removeObserver(self, name: ReachabilityChangedNotification, object: nil)
        }
    }


    func reachabilityChanged(note: NSNotification) {
        let reachability = note.object as! Reachability
        // Initial reachability check while surfing in the app
        if reachability.isReachable() {
            let alertController = UIAlertController(title: "Alert", message: "Reachable", preferredStyle: .Alert)
            let defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)

            alertController.addAction(defaultAction)

            self.presentViewController(alertController, animated: true, completion: nil)

        } else {
            let alertController = UIAlertController(title: "Alert", message: "Please connect to internet", preferredStyle: .Alert)
            let defaultAction = UIAlertAction(title: "OK", style: .Default, handler: nil)

            alertController.addAction(defaultAction)

            self.presentViewController(alertController, animated: true, completion: nil)
        }
    }



    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

Upvotes: 2

Views: 1326

Answers (1)

qin
qin

Reputation: 1713

You need to debug your app in a NAT64 Network. (You can create it by using your macOS.)

How to create a NAT64 Network.

And Apple support article is following: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html

Upvotes: 1

Related Questions