title: App Icon won't show in music controls in app switcher
body: <p>I'm writing an app that streams music and I'm having a ton of trouble setting the icon on the music control dock screen (when you double-click the home button and swipe to the left). All the documentation said to do something like this, but the icon never appears and I don't ever receive the event notification. All of this code is in my player view controller. _radioPlayer is an instance of an AVQueuePlayer. What am I doing wrong here?</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated
  {
      UIApplication *application = [UIApplication sharedApplication];
      if([application respondsToSelector:@selector(beginReceivingRemoteControlEvents)])
          [application beginReceivingRemoteControlEvents];
      [self becomeFirstResponder];
  }
  
  - (BOOL)canBecomeFirstResponder
  {
      return YES;
  }
  
  - (void)remoteControlReceivedWithEvent:(UIEvent *)event {
      switch (event.subtype) {
          case UIEventSubtypeRemoteControlTogglePlayPause:
              [_radioPlayer pause];
              break;
          case UIEventSubtypeRemoteControlPlay:
              [_radioPlayer play];
              break;
          case UIEventSubtypeRemoteControlPause:
              [_radioPlayer pause];
              break;
          default:
              break;
      }
  }
  </code></pre>
  
  <p>EDIT: I read through the <a href="http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/Remote-ControlEvents/Remote-ControlEvents.html" rel="nofollow" title="documentation">documentation</a> and followed the steps but it's still not working. Here are some of the possible reasons I've come up with:</p>
  
  <p>A. My music isn't playing yet when viewDidAppear is called. In the documentation it states</p>
  
  <blockquote>
    <p>"Your app must be the “Now Playing” app. Restated, even if your app is the first responder >and you have turned on event delivery, your app does not receive remote control events until >it begins playing audio."</p>
  </blockquote>
  
  <p>I tried calling <code>beginReceivingRemoteControlEvents:</code> and <code>becomeFirstResponder:</code> after the music starts playing but this doesn't work either. Can these only be called in <code>viewDidAppear:</code>? Does iOS automatically detect when the music begins playing so this isn't necessary?</p>
  
  <p>B. There is something weird about using an AVQueuePlayer. I'm almost positive this isn't it since the event message is handled by the view controller, not the player itself.</p>