I am writing a music playing app which performs a task between each song. I need to do this even when the app is in the background, so I need to know when a song has completed. At the moment I am using AVPlayer which sends notifications even when the app is in the background, but is unable to play songs from the user's iCloud. MPMediaPlayerController can play iCloud songs but doesn't send notifications when the app is in the background (which is essential to my app).
So, does anyone know either
- Any clever ways of having
AVPlayerplay iCloud songs, or - Having my app recognise when a song playing via
MPMusicPlayerControllerhas completed when the app is in the background?