Error code for UIRequiresPersistentWiFi

Hi,


According to the documentation for the UIRequiresPersistentWiFI InfoPlist key, "iOS opens a Wi-Fi connection when this app is launched and keeps it open while the app is running". This suggests an app running on a phone that only has WiFi would fail to make requests with URLSession. I'd like to know how often this happens, is there an error code like the ones listed in https://developer.apple.com/documentation/foundation/1508628-url_loading_system_error_codes to indicate specifically that a request my app made failed because the Wi-Fi connection was closed?


Thanks!

This suggests an app running on a phone that only has Wi-Fi would fail to make requests with

URLSession
.

No. If a phone has no working WWAN, critical system services, like push notifications, run over Wi-Fi, which disables the logic that shuts down the Wi-Fi.

Still, if you want to test this, it’s easy to do: Just disable WWAN in Control Center.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Error code for UIRequiresPersistentWiFi
 
 
Q