Background Mode audio not working in iOS

We’re trying to play audio that still playing after the app is in background with our Ionic + Vue project.

We’re using web audio API to play audio.

const audio = new Audio(url)

Then we install plugin, enable it and it works on Android but not on iOS

import { BackgroundMode } from '@ionic-native/background-mode'


Background mode is set for audio in Xcode.

Any help or guidance would be very much appreciated, thanks.

Hi there

As far as I can tell this is a nightmare. I have been struggling with this for the past week, and is using this plugin right now.
If I install Ionic Native Media, the plugin will use that instead of the web html5 player, which seems to suffer in iOS 13 when screen is black.

This means I got it working in iOS 13 right now, but is having different results on different devices. Some devices works fine, while others doesn’t if the user press “home” followed by “power” (iPhone).
I have audio files both present on the device is streaming from web. Both acts the same.

If you find a working solution, I would appreciate a heads-up

btw I am using ionic 3

For now use the Streaming Media plugin, because IOS accepts native audio, and it does not block, and disable background mode

I was able to solve the problem by changing


[session setCategory:AVAudioSessionCategoryPlayback

changed to:

[session setCategory:AVAudioSessionCategoryPlayback