Watch-Only and Independent apps have no network connection when paired with an iPhone (Network Proxy through iPhone)

Hi there,

I think I may have caught a bug in the iOS system. Please confirm.

Problem

Newly installed Watch-Only and Independent apps on the Apple Watch do not have a network connection when paired with an iPhone until the iPhone is rebooted. Please see the attached screenshot; the iPhone indicates 'WiFi and Cellular policy: kDeny'.

Use Case

For our end-users, they will install the Watch-Only app directly from the App Store on the Apple Watch, and of course, their watch is paired with their iPhone. In this case, the Watch-Only app has no network connection at all after installation. The user has to reboot the iPhone once, and then the Watch-Only app can access the network. It is unacceptable for the end-users.

System Info

WatchOS: 10.1.1

Watch Model: A2770, Apple Watch Series 8 (GPS only)

iOS Version: 17.4.1

iPhone Model: iPhone 15

XCode: 15.3

How to reproduce

  1. Please download the very simple sample code attached. It features the official URLSession Demo Code, which initiates a default URLSession to access https://www.example.com.

  1. Prepare an iPhone and an Apple Watch, then connect the watch to the iPhone and ensure they are paired correctly.
  2. Ensure that your iPhone properly connects to a working WiFi network.
  3. Now, connect both your Apple Watch and iPhone to Xcode and run the code on the watch. Xcode will then install the Watch-Only app on your watch.
  4. After installation, click the 'Click' button on the watch app, and you will receive an error message stating 'The Internet connection appears to be offline...'
  5. Now, check the Console output of your iPhone and filter by 'wifi policy'. You will see logs stating 'Adding CU Policy: Bundle IDs: (the-bundle-id) Wifi policy: kDeny Cellular policy: kDeny'.
  6. Now, reboot your iPhone and wait for it to reconnect to the WiFi network.
  7. Check the Control Center on your watch to ensure the little green iPhone icon is displayed, indicating that your watch is now paired correctly with the iPhone. Click the 'Click' button again on the watch app, and this time it will work perfectly.
  8. To repeat the process, simply uninstall the watch app from your watch, and run the sample code again. Xcode will reinstall the app onto the watch. This time, the app will not work until you reboot the iPhone again.

References

Proxy Through iPhone https://developer.apple.com/documentation/watchos-apps/keeping-your-watchos-app-s-content-up-to-date#Test-your-update-code-with-different-configurations

Sample Code


struct ContentView: View {
    
    @State var txt = "Hello World!"
    
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)	
            
            Text(txt)
            
            Button("Click") {
                startLoad()
            }
        }.padding()
    }
    
    func startLoad() {
        let config = URLSessionConfiguration.default
        config.waitsForConnectivity = false
        config.allowsCellularAccess = true
        config.allowsExpensiveNetworkAccess = true
        config.allowsConstrainedNetworkAccess = true

        let sesh = URLSession(configuration: config)
        let url = URL(string: "https://www.example.com")!
        
        sesh.dataTask(with: url) { data, response, error in
            if let error = error {
                self.txt = error.localizedDescription
                // self.handleClientError(error)
                return
            }
            
            guard let httpResponse = response as? HTTPURLResponse,
                (200...299).contains(httpResponse.statusCode) else {
                self.txt = response.debugDescription
                // self.handleServerError(response)
                return
            }
            
            if let mimeType = httpResponse.mimeType, mimeType == "text/html",
                let data = data,
                let string = String(data: data, encoding: .utf8) {
                
                DispatchQueue.main.async {
                    self.txt = string
                    // self.webView.loadHTMLString(string, baseURL: url)
                }
            }
        }.resume()
    }
}

#Preview {
    ContentView()
}


Replies

Hello, thanks for all of the information in your post! The log you indicated typically means that they app does not have access to Cellular or Wi-Fi, which is a setting configured by a user. In this case, it sounds like that enforcement is happening unexpectedly. If possible, would you be able to install the sysdiagnose profile and follow the instructions to attach the sysdiagnose to a Feedback report? We'll need this logging from various other subsystems to have a better idea of what is going on here. Thanks!

  • Thank you. I will provide Developer Feedback later. For now, I would like to emphasize it cannot be configured by the user because it is a watch-only app (or independent app without a companion iOS app), there is no way for users to allow network access on the iPhone since it will not appear on the iPhone at all. The only thing I can find is in the iPhone's Watch management app under the "INSTALLED ON APPLE WATCH" section, but the only option available is "Delete app on Apple Watch".

  • Hi there, I just submitted a Feedback with sysdiagnose logs. Feedback ID: FB13704939 Please let me know anything else you need on my side. Thank you.

    Timeline: Log begin - 4/2/2024 14.43:11.559161 : Xcode installing the app 4/2/2024 14:43:29.797635 - 4/2/2024 14:44 : Reproduced the issue for 10+ times, all network error. 4/2/2024 14:44 - 4/2/2024 14:45 : Reboot the iPhone without any other changes. 4/2/2024 14:45:10.942653 : Click the button on the watch app again multiple times and it works.

  • Dear Apple Developer Team, Do we have any update on Feedback ID: FB13704939? The feedback has remained Open for a week, and no one has responded to my comments. I just want to know the average wait time before we can get an answer from feedback. If needed, I can reproduce the issue for you at anytime, but please let us know your thoughts on it at least. Our customer is asking for a solution, and we have no information to provide. It's very embarrassing. Thank you in advance. Sincerely.

Add a Comment