title: How to update MPNowPlayingInfoCenter when using MPMusicPlayerApplicationController
body: <p>I'm trying to update <code>MPNowPlayingInfoCenter</code> with the song info of a track that I'm playing from Apple Music.  I have done the following:</p>
  
  <p>Set my background mode to: "Audio, Airplay, and Picture in Picture",</p>
  
  <p>Correctly set my <code>AVAudioSession</code> category:  </p>
  
  <pre><code>let session = AVAudioSession.sharedInstance()
  
  do {
      try session.setCategory(AVAudioSessionCategoryPlayback, with: [])
      try session.setActive(true)
  } catch let error as NSError {
      print("Failed to set the audio session category and mode: \(error.localizedDescription)")
  }
  </code></pre>
  
  <p>Setup the <code>MPRemoteCommandCenter</code> to respond to remote commands:</p>
  
  <pre><code>let commandCenter = MPRemoteCommandCenter.shared();
  commandCenter.playCommand.isEnabled = true
  commandCenter.playCommand.addTarget {event in
      self.player.play()
      return .success
  }
  commandCenter.pauseCommand.isEnabled = true
  commandCenter.pauseCommand.addTarget {event in
      self.player.pause()
      return .success
  }
  commandCenter.nextTrackCommand.isEnabled = true
  commandCenter.nextTrackCommand.addTarget {event in
      self.goForward()
      return .success
  }
  commandCenter.previousTrackCommand.isEnabled = true
  commandCenter.previousTrackCommand.addTarget {event in
      self.goBack()
      return .success
  }
  </code></pre>
  
  <p>And updating <code>MPNowPlayingInfoCenter</code> with correct information on-start and whenever there are playback events:</p>
  
  <pre><code>let info: [String:Any] = [
      MPMediaItemPropertyAlbumTitle : albumTitle,
      MPNowPlayingInfoCollectionIdentifier : albumId,
      MPMediaItemPropertyArtist : artistName,
      MPNowPlayingInfoPropertyMediaType : mediaType,
      MPMediaItemPropertyPersistentID : trackId,
      MPMediaItemPropertyTitle : trackTitle,
      MPMediaItemPropertyPlaybackDuration : trackDuration,
      MPNowPlayingInfoPropertyExternalContentIdentifier : trackId,
      MPNowPlayingInfoPropertyPlaybackRate : isPlaying ? 1.0 : 0.0,
      MPNowPlayingInfoPropertyPlaybackProgress : 0.5,
      MPMediaItemPropertyArtwork : MPMediaItemArtwork(boundsSize: CGSize(width: 100, height: 100), requestHandler: { (size: CGSize) -&gt; UIImage in
          return UIImage(named: "play")! // dummy purposes
      })
  ]
  
  let infoCenter = MPNowPlayingInfoCenter.default()
  infoCenter.nowPlayingInfo = info
  infoCenter.playbackState = isPlaying ? .playing : .paused
  </code></pre>
  
  <p><strong>What more do I need to do in order for the song info to appear in Control Center and on the lock screen?</strong></p>