Hi
According to this thread
https://developer.apple.com/forums/thread/663852 , when I want to check if permission was denied I should create NWConection and check status and its unsatisfiedReason property.
It is working when device is connected to the WiFi network where given host with ip address is existing like 192.168.100.1.
But I have two cases when proposed solution is not working for me.
1) Device is connected to Wifi network where there is no host with given ip. Then when i try to create connection with NWConnection then for .waiting status I get
waiting(POSIXErrorCode: Connection refused)
Network.NWPath.UnsatisfiedReason.notAvailable
2) when wifi is disabled and and user is using only gsm when i want to create NWConnection to given address I'm receiving after long time
.waiting(POSIXErrorCode: Operation timed out)
Network.NWPath.UnsatisfiedReason.notAvailable
So it seems like .localNetworkDenied for NWPath.UnsatisfiedReason property is only returned for NWConnection to host that exist in current connected Wifi network.
Can you confirm it?
Basically I want to implement functionality that view is showing for the user that denied access to Local Area Privacy Network and he is connected to any Wifi network or even not connected at all.
Is it possible, please advise?
thanks
According to this thread
https://developer.apple.com/forums/thread/663852 , when I want to check if permission was denied I should create NWConection and check status and its unsatisfiedReason property.
It is working when device is connected to the WiFi network where given host with ip address is existing like 192.168.100.1.
But I have two cases when proposed solution is not working for me.
1) Device is connected to Wifi network where there is no host with given ip. Then when i try to create connection with NWConnection then for .waiting status I get
waiting(POSIXErrorCode: Connection refused)
Network.NWPath.UnsatisfiedReason.notAvailable
2) when wifi is disabled and and user is using only gsm when i want to create NWConnection to given address I'm receiving after long time
.waiting(POSIXErrorCode: Operation timed out)
Network.NWPath.UnsatisfiedReason.notAvailable
So it seems like .localNetworkDenied for NWPath.UnsatisfiedReason property is only returned for NWConnection to host that exist in current connected Wifi network.
Can you confirm it?
Basically I want to implement functionality that view is showing for the user that denied access to Local Area Privacy Network and he is connected to any Wifi network or even not connected at all.
Is it possible, please advise?
thanks