Post

Replies

Boosts

Views

Activity

Detecting an Archive vs. Development build
I have a 3rd party library that requires a licensing key. I have two: I have a development key that will not work with IPAs and is used to build to a phone in development. And I have a Production key which will workonly from an IPA/Archive build but not directly on a phone. Is there a compiler directive that can tell me if I am building to an Archive/IPA or developmently to a phone? Currently I have resorted to creating separate project targets to achieve this task, but it is clumsy and inelegant (and prone to error). I am using XCode13 & Swift 5.5 Thanks-in-advance, Tom
1
0
449
Oct ’21
NETWORK: NWPathMonitor non-functional on AppleWatch
I’m trying to trace down connectivity issue with a Watch App; Preflighting the app has Bluetooth and WIFI Access.   I have code that works well on iOS, but the NWPathMonitor always return that there is not Network connection because “unsatisfied (Path was denied by NECP policy), interface: ipsec0, ipv4” What is NECP? What is NECP Policy? Why does this work in the simulator but not on the real device? If this is not intended for the watch, why can I build this with no errors or warnings from the compiler? Thanks, Thomas   Source: import Network         // Network Stuff    let monitor = NWPathMonitor() //  let monitor = NWPathMonitor(requiredInterfaceType: .cellular) //  let monitor = NWPathMonitor(requiredInterfaceType: .wifi)    let queue = DispatchQueue(label: "InternetConnectionMonitor")    var queueStarted:Bool = false            monitor.pathUpdateHandler = { pathUpdateHandler in        print( "\npathUpdateHandler = \(pathUpdateHandler)" )        if pathUpdateHandler.status == .satisfied {          DispatchQueue.main.async {            print("Internet connection is on.")        }       } else {          DispatchQueue.main.async {            print("There's no internet connection.")         }       }     }      if !queueStarted {        monitor.start(queue: queue)        queueStarted = true     }     Output:   pathUpdateHandler = unsatisfied (Path was denied by NECP policy), interface: ipsec0, ipv4) There's no internet connection.  
4
1
2.4k
Aug ’20