title: Detect screen on/off from iOS service
body: <p>I am developing a network monitor app that runs in background as a service. Is it possible to get a notification/call when the screen is turned on or off?</p>
  
  <p>It exists in Android by using the following code:</p>
  
  <pre><code>private void registerScreenOnOffReceiver()
  {
     IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
     filter.addAction(Intent.ACTION_SCREEN_OFF);
     registerReceiver(screenOnOffReceiver, filter);
  }
  </code></pre>
  
  <p>screenOnOffReceiver is then called when screen is turned on/off. Is there a similar solution for iOS?</p>
  
  <p><strong>Edit:</strong>
  The best I've found so far is UIApplicationProtectedDataWillBecomeUnavailable  ( <a href="https://stackoverflow.com/questions/6114677/detect-if-iphone-screen-is-on-off">Detect if iPhone screen is on/off</a> ) but it require the user to enable Data Protection (password protection) on the device.</p>