title: iOS 7 SDK not abiding background audio
body: <p>I have done a lot of research, both on Google and StackOverflow. All the answers I found do not work in iOS 7. I started writing fresh app in iOS 7 SDK with Xcode 5.</p>
  
  <p>All I'm trying to do is play audio in the app from a file stored in the app bundle (not from the Music library). I want to have <strong>audio played in background and controlled when screen is locked</strong> (in addition to Control Center).</p>
  
  <p>I set the <code>APPNAME-Info.plist</code> key, <code>UIBackgroundModes</code>, to <em>audio</em>. It is not handling things in the app delegate; everything is done inside the ViewController</p>
  
  <pre><code>@interface ViewController : UIViewController &lt;AVAudioPlayerDelegate&gt;
  </code></pre>
  
  <p>Within the implementation's <code>viewDidAppear:</code> method I call super and then the following code:</p>
  
  <pre><code>// Once the view has loaded then we can register to begin receiving controls and we can become the first responder
  [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
  [self becomeFirstResponder];
  </code></pre>
  
  <p>In my implementation's <code>viewWillDisappear:</code> method, I have the following code:</p>
  
  <pre><code>// End receiving events
  [[UIApplication sharedApplication] endReceivingRemoteControlEvents];
  [self resignFirstResponder];
  </code></pre>
  
  <p>I have also implemented the <code>canBecomeFirstResponder</code> method, which returns <strong>YES</strong>. Next, I implemented the <code>remoteControlReceivedWithEvent:</code> method:</p>
  
  <pre><code>- (void)remoteControlReceivedWithEvent:(UIEvent *)event {
      // If it is a remote control event handle it correctly
      if (event.type == UIEventTypeRemoteControl) {
          if (event.subtype == UIEventSubtypeRemoteControlPlay) {
              [self playPauseAudio:self];
          } else if (event.subtype == UIEventSubtypeRemoteControlPause) {
              [self playPauseAudio:self];
          } else if (event.subtype == UIEventSubtypeRemoteControlTogglePlayPause) {
              [self playPauseAudio:self];
          }
      }
  }
  </code></pre>
  
  <p>What is confusing me is that this exact same setup was working fine on iOS 6. On iOS 7, it doesn't work. It used to be so easy in iOS 6. Something fundamentally changed in iOS 7 SDK. What am I missing?</p>