Flutter audio_service with just_audio iOS17 playback stops in background

114 views Asked by At

Using audio_service with just_audio, I'm getting reports of playback failing when the lock screen is engaged on iOS 17. The functionality works fine in the simulator (of course!) and so far only a handful of users have reported this (but repeatedly).

The only log I can see is in the call to just_audio -> AudioPlayer() -> play() which fails Dart side with 'PlatformException' is not a subtype of type 'PlayerException'. I see no errors in the xcode crash logs.

The user has to close and restart the app, then background playback works fine for a while. One user has reported that their Tidal app is also showing this behaviour since they updated to iOS 17. The users who have reported are on iPhone 14 and iPhone 15 Pro and had no issues prior to iOS 17. In all cases the audio asset is local to the device, so I'm ruling out networking issues at the moment.

This feels like a similar condition to the Android "background app kill", which I am having to manage with a battery saver warning to the user. Any ideas what might have changed in iOS 17 and how we can prevent this?

Thanks!

0

There are 0 answers