I have tried this code to show media info:
import MediaPlayer
let audioInfo = MPNowPlayingInfoCenter.defaultCenter()
audioInfo.nowPlayingInfo = [ MPMediaItemPropertyTitle: "Miley_Cyrus_", MPMediaItemPropertyArtist:"artistName"]
This is working fine on simulator as shown into image:
But this is not working correctly on real Device:
There is no media info displayed in real device as displayed into simulator. Am I missing something?
I have just found the solution for it
UIApplication.sharedApplication().beginReceivingRemoteControlEvents()
This is working fine.
Reference from HERE.