cordova-music-controls-plugin
cordova-music-controls-plugin copied to clipboard
Music controls don't work with background mode on iphone
Using ionic 3 and deploying to iphone. When background mode is enabled music controls don't show up at all. with background mode turned off music stops on screen lock and music controls show up but don't do anything.
cordova-plugin-music-controls: 2.1.4 cordova-ios: 4.4.0 cordova-plugin-background-mode: 0.7.2
Make sure you are using the UIWebView and not the new WKWebView in Ionic. (WKWebView is the default) https://ionicframework.com/docs/wkwebview/
Tried both options for downgrading and still didn't work
I was able to get it to work by using the ionic media plugin. This for some reason runs the audio in the background without the background mode on.
https://github.com/katzer/cordova-plugin-background-mode/pull/274/files
fixes it
This plugin doesn't use https://github.com/katzer/cordova-plugin-background-mode though right? or am I supposed to install the plugin?
The problem with the background mode plugin is that it plays a silent audio file in the background continuously to fake activity and stop suspension of the app even when it's idle. It may be fixed now but the problem was that the background-mode plugin steals the audio session.
I would recommend giving the ionic-webview plugin a look if you want background processing support as it enables background processing but doesn't fake any work load so the OS can still suspend your add as it needs to when it is idle.