Since iOS 14 there is a Local Network Permission and Apple recommends to use waitsForConnectivity
on the connection to wait for the user to answer the permission pop-up.
To check if a connection attempt is waiting for the permission Apple recommends the unsatisfiedReason
property here to check for localNetworkDenied
.
I tried to adapt Apples recommendation to Alamofire but couldn't think of anything.
My specific use case is an iOS app which connects to a server on the internet but sometimes the iOS device visits the home network of the server. For the latter it needs the permission and I want to give a good error message to the user if they revoked the local network permission (because in this case the iOS permission dialog doesn't appear again).
How can I archive this with Alamofire?