Multipath

NSURLSessionConfiguration *cfg = [NSURLSessionConfiguration defaultSessionConfiguration]; cfg.allowsCellularAccess = YES; cfg.multipathServiceType = NSURLSessionMultipathServiceTypeInteractive; NSURLSession *session = [NSURLSession sessionWithConfiguration:cfg]; NSURL *url = [NSURL URLWithString:@"https://www.apple.com"]; [[session dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *resp, NSError *err) { if (err) { NSLog(@"❌ Request failed: %@", err); } else { NSLog(@"✅ Received %lu bytes via %@", (unsigned long)data.length, resp.URL.absoluteString); } }] resume];

When I use NSURLSession and set multipathServiceType = NSURLSessionMultipathServiceTypeInteractive, whenever I’m connected to a Wi‑Fi network without Internet access, all of my app’s network requests automatically and seamlessly fall back to cellular to fetch data. Why, then, can’t WKWebView load pages? What do I need to configure? Notes:

  1. My developer account already has the Multipath entitlement.
  2. I’ve added the Multipath capability under Signing & Capabilities in Xcode.
  3. In my .entitlements file I’ve set com.apple.developer.networking.multipath = true.
Multipath
 
 
Q