title: iOS swift Background Refresh system settings - identify cellular data transfer
body: <p><strong>Some background information</strong><br>
  I'm using the silentPush feature (<code>didReceiveRemoteNotification</code>) to keep the iOS app synced with other platforms and my backend. </p>
  
  <p>So just to be sure, that the user enabled Background Refresh in his iOS settings, I'm checking the devices settings with the following code:  </p>
  
  <pre><code> // Check Background Refresh
   switch UIApplication.shared.backgroundRefreshStatus {
   case .available:
      // iOS background refresh is enabled in iOS settings
      // -&gt; No need to ask user for permission
      break
   case .denied:
      // iOS background refresh is disabled in iOS settings
      // here is my code to notify user to enable his background refresh iOS settings
      break
   }
  </code></pre>
  
  <p>According to the Apple documentation (<a href="https://developer.apple.com/documentation/uikit/uiapplication/1622994-backgroundrefreshstatus" rel="nofollow noreferrer">https://developer.apple.com/documentation/uikit/uiapplication/1622994-backgroundrefreshstatus</a>) there is a property <code>backgroundRefreshStatus</code>, which indicates, if the user has enabled the background services -> This is exactly the code I implemented above.</p>
  
  <blockquote>
    <p>This property reflects whether the app can be launched into the background to handle background behaviors, such as processing background location updates and performing background fetches. If your app relies on being launched into the background to perform tasks, you can use the value of this property to determine if doing so is possible and to warn the user if it is not. Do not warn the user if the value of this property is set to restricted; a restricted user does not have the ability to enable multitasking for the app.   </p>
  </blockquote>
  
  <p>The following phrase is now interesting in my case  </p>
  
  <blockquote>
    <p>you can use the value of this property to determine if doing so is possible and to warn the user if it is not   </p>
  </blockquote>
  
  <p>I had a look into the iOS background refresh system settings and found 3 possible values, which the user can set:</p>
  
  <ol>
  <li>Aus (Off)</li>
  <li>WLAN (WiFi)</li>
  <li><p>WLAN &amp; Mobile Daten (WiFi &amp; Cellular / Mobile Data)</p>
  
  <p><a href="https://i.stack.imgur.com/LhUpX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LhUpX.png" alt="enter image description here"></a></p></li>
  </ol>
  
  <p><strong>Now my question:</strong><br>
  I would like to ask the user for background service permission, if the settings are either on <code>off</code> or only on <code>Wifi</code> (see red rectangle). According to Apples documentation, there is only the possibility to check the general settings -> either on or off. Is there any possibility to check it like I mentioned it on the screenshot?</p>