NWPathMonitor return .unsatisfied on iOS 17.*

I am using NWPathMonitor to check the connectivity status.

let monitor = NWPathMonitor()
monitor.pathUpdateHandler = { path in
     if path.status == .satisfied {
               print("Satisfied")
     } else {
               print("Not Satisfied")
     }
}

This method functioned properly before iOS 17. However, with iOS 17 and later versions, I notice the following log output:

nw_path_evaluator_cancel [00000000-0000-0000-0000-000000000000] cancel

Interestingly, this issue with MWPathMonitor only appears in my live app. I don't encounter any unusual behavior in Testflight or XCode. I'd appreciate any assistance on this matter.

Are you doing anything to maintain a strong reference to monitor. I suspect that you’re not and so, when the last reference is released, it cancels itself.

Share and Enjoy

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

NWPathMonitor return .unsatisfied on iOS 17.*
 
 
Q