NSURLErrorDataNotAllowed

NSURLErrorDataNotAllowed Data Usage Not Allowed on iOS Error

Category: Platform-Specific Errors | Platforms: ios

What This Error Means

This error arises when an iOS application tries to access the network, but the system's configuration prevents it. The most common reason is that the user has disabled cellular data for the specific app or globally, or has enabled Low Data Mode which restricts background data usage.

Common Causes

  • Cellular data is disabled for the specific app in iOS settings.
  • Low Data Mode is enabled, restricting background network access.
  • The device is in Airplane Mode.
  • A custom VPN or firewall configuration is blocking the app's network requests.

How to Fix It (For Users)

  1. 1 Check iOS Settings > Cellular and ensure that cellular data is enabled for the specific app.
  2. 2 Disable Low Data Mode in iOS Settings > Cellular > Cellular Data Options or iOS Settings > Wi-Fi > [Your Wi-Fi Network] if enabled.
  3. 3 Disable Airplane Mode in Control Center or Settings.
  4. 4 Review VPN settings (if applicable) and ensure the app is allowed to bypass the VPN.

For Site Owners / Developers

  1. Implement reachability checks to determine network availability before making requests.
  2. Use `URLSessionConfiguration.allowsCellularAccess` to respect user's cellular data settings.
  3. Gracefully handle `NSURLErrorDataNotAllowed` errors and provide informative messages to the user, guiding them to check their data settings.
  4. Optimize your app's data usage to minimize network requests and reduce data consumption, especially when Low Data Mode is enabled. Consider using `URLSessionConfiguration.isDiscretionary = true` for background tasks.

When It Is NOT Your Fault

This error usually indicates a user-configured restriction, making it outside the application's control. However, constantly retrying network requests when data is disallowed can drain battery and provide a poor user experience. Proper error handling is crucial.

Is the website actually down?

Sometimes the issue is just on your end. Check if the website is down for everyone or just you.

Check Website Status →

Recommended Tool to Prevent This Error

Prevent server timeouts and resource exhaustion with scalable cloud infrastructure.

High-Performance Cloud Hosting