Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70443

How to exclude my ionic app from the android Battery Optimization

$
0
0

@claudioacanfora wrote:

Hi all, I’m a newbie here on the ionic/android developing world, so first, let me thanks anyone will answer me!

I’ve built a very simple Ionic 4 app that play some audio stream. It works nice, however the audio stops when the app goes in background, after more or less 3 minutes. This is due the Android Battery Optimization built in the system. (if you manually exlude the app from those optimizations, the app works forever…)

So my question: is there a way to exclude my app from those battery optimizations during the install process and/or at the first launch of my app?

I’ve been playing with the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS attribute into the AndroidManifest.xml but so far, didn’t get it work.

Here the versioning of my environment:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 
   Ionic Framework               : @ionic/angular 4.2.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms     : android 8.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 8 other plugins)

System:

   Android SDK Tools : 26.1.1 
   NodeJS            : v8.9.3 
   npm               : 5.6.0
   OS                : Windows 10

Thanks again!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>