Swiftui Lost network connection permanently after disabling and enabling the Local Network permission

In the development environment, if I disable and then enable the Network Connection permission to my app in the Setting on my device, my app is denied the network connection permission permanently. The error message is The Internet connection appears to be offline.

Please advise me what to do.

What platform is this on? And what version of that OS?

Also, I’d like more details about exactly what you tested here. My best guess is this:

  1. Run the app from Xcode.

  2. Perform a local network operation.

  3. It prompts for local network access. Allow that.

  4. Stop the app.

  5. In Settings, disable the app’s Local Network privilege.

  6. Run the app from Xcode again.

  7. Perform a local network operation.

  8. It doesn’t prompt for local network access, because it’s already prompted once. Instead, the operation just fails.

  9. Stop the app.

  10. In Settings, enable the app’s Local Network privilege.

  11. Run the app from Xcode again.

  12. Perform a local network operation.

  13. It doesn’t prompt for local network access, because it’s already prompted once. However, the operation fails rather than being allowed.

Is that right?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Swiftui Lost network connection permanently after disabling and enabling the Local Network permission
 
 
Q