1

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:

enter image description here

But this is not working correctly on real Device:

enter image description here

There is no media info displayed in real device as displayed into simulator. Am I missing something?

Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165

1 Answers1

1

I have just found the solution for it

UIApplication.sharedApplication().beginReceivingRemoteControlEvents()

This is working fine.

Reference from HERE.

Community
  • 1
  • 1
Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165