I am creating an iPhone application that processes music, pauses and maintains its own playlist. This application does not provide the function of the next / previous song, so I do not want these buttons to be displayed in the iOS Control Center (slide screen).
I tried the following code so that they disappear from there:
MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter]; // Do not allow next/prev song command on remote control since this is not supported in app either commandCenter.nextTrackCommand.enabled = NO; commandCenter.previousTrackCommand.enabled = NO; [commandCenter.nextTrackCommand addTarget:self action: @selector(emptyFunction)]; [commandCenter.previousTrackCommand addTarget:self action: @selector(emptyFunction)];
This does not work: regardless of whether the application is playing music, these two buttons are still displayed on the slide screen and they are not grayed out and they perform a function (although not correctly, but they are not connected).
How can I make them disappear?
source share