Avoid stopping music on opening an Ionic App

Hello,

If I listen music (on Spotify for example) and then I open the Ionic app, the sound is paused.
Is there a way to avoid this?

Thanks for your help,
Loïc

Please post which plugins you are using

Hi @EinfachHans,

sorry for my late reply :confused:

Here are the plugins used in the file app.component.ts :

import { Component, NgZone } from '@angular/core';
import { Platform, NavController, AlertController } from '@ionic/angular';
import { SplashScreen } from '@capacitor/splash-screen';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { NavigationBar } from '@ionic-native/navigation-bar/ngx';
import { StatusBar, Style } from '@capacitor/status-bar';
import { Router, NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import { Store } from '@ngrx/store';
import { Market } from '@ionic-native/market/ngx';
import { App, URLOpenListenerEvent } from '@capacitor/app';

Kind regards

I’ve the same problem, my app doesn’t use audio feature and/or plugins.

Any idea on how to solve?

Hmmm, I haven’t seen this before. Can you provide a mimimal example?

i’ve solved removing cordova plugin background mode since i don’t use it anymore.

but this guy has patched the background-mode plugin for fixing it.

https://bitbucket.org/JesperBalslev/cordova-plugin-run-in-background/diff/src/ios/APPBackgroundMode.m?at=master&diff2=159e0db0ffadc4c99e184d80c58c23e3dda8899e

1 Like