Control Center Play/Pause Button not working in iOS 11

2.9k Views Asked by At

My app plays audios in the background I am updating the MPNowPlayingInfoCenter to show the Audio's Info in Control Center.

All was working fine on iOS 10, but now when I updated my iPhone to iOS 11 beta2 and play the audio in my app then control center's play/pause button and the next/previous buttons for music are not working, however, the control center is showing Audio's name in control center.

Below is my code I use to update control center

NSMutableDictionary *attributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       self.audioName, MPMediaItemPropertyTitle,
                                       [NSNumber numberWithFloat:self.playbackRate], MPNowPlayingInfoPropertyPlaybackRate,
                                       [NSNumber numberWithFloat:duration], MPMediaItemPropertyPlaybackDuration,
                                       [NSNumber numberWithFloat:progress], MPNowPlayingInfoPropertyElapsedPlaybackTime,
                                       nil];

Can someone tell how can I fix this bug of Control Center? Or this is the bug in iOS?

1

There are 1 best solutions below

0
Dean On

I had problems with beta 2 to use the control center with the Music.app But it's fixed with the beta 3. My thinking is that it was an iOS bug. You should update to beta 3 and see if it solve your bug !