Is it Possible for an app to know whether the connection has been switched from Wi-Fi to 3G While app is in background?The requirement is that download should happen on Wi-Fi Connection.The Check is done initialy but i need to confirm that download is happening on Wi-Fi and should be cancelled if the user has switched to 3G/4G while app is in Background.
If you just want to make sure downloads only happen on WiFi, then you should set the allowsCellularAccess
property of the NSURLSession's NSURLSessionConfiguration to NO
.
No monitoring, cancelling or other tricks needed: that'll make sure the download never goes over the cellular connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With