How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter
<p><a href="https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPRemoteCommandCenter_Ref/" rel="nofollow noreferrer">Apple doc</a> says &quot;you can disable the corresponding MPRemoteCommand object by setting its enabled property to NO.&quot;</p>
<p>I referred <a href="https://stackoverflow.com/questions/20591156/is-there-a-public-way-to-force-mpnowplayinginfocenter-to-show-podcast-controls">Is there a public way to force MPNowPlayingInfoCenter to show podcast controls?</a> and I was able to disable/enable a particular command on lock screen control.</p>
<p>However I want to disable all the controls from lock screen control since I am playing a radio and it do not support either of the action - &quot;Play/Pause/Next/Previous&quot;</p>
<p>I tried following code snippet:</p>
<pre><code>MPRemoteCommandCenter *remoteCommandCenter = [MPRemoteCommandCenter sharedCommandCenter];
remoteCommandCenter.previousTrackCommand.enabled = NO;
[remoteCommandCenter.previousTrackCommand removeTarget:self];
remoteCommandCenter.nextTrackCommand.enabled = NO;
[remoteCommandCenter.nextTrackCommand removeTarget:self];
            
remoteCommandCenter.skipBackwardCommand.enabled = NO;
[remoteCommandCenter.skipBackwardCommand removeTarget:self];
remoteCommandCenter.skipForwardCommand.enabled = NO;
[remoteCommandCenter.skipForwardCommand removeTarget:self];
            
remoteCommandCenter.bookmarkCommand.enabled = NO;
[remoteCommandCenter.bookmarkCommand removeTarget:self];

remoteCommandCenter.playCommand.enabled = NO;
[remoteCommandCenter.playCommand removeTarget:self];
            
remoteCommandCenter.pauseCommand.enabled = NO;
[remoteCommandCenter.pauseCommand removeTarget:self];
</code></pre>
<p>However it didn't work. Disabling everything enables pause, previous, next button on lock screen.
Any help would be greatly appreciated.</p>