Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49087

Ionic PowerManagement Plugin is crashing my app! WELP

$
0
0

Hello guys!

I am using Ionic Cordova PowerManagement plugin in my project but the plugin is making my app crash
whenever i call dim() and ReleaseOnPause() functions. I don’t know what is wrong with my codes. Also I just want the wakeupCalls from PowerManagement so if you know any other APIs, pls do tell me. Need help urgently

Here is my code which is in initalizeApp in app.component.ts

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();
      this.backgroundMode.enable();

      this.backgroundMode.disableBatteryOptimizations();

      let huh = "";

      this.foregroundService.start("Unusual Music player", "is playing music in the background, stats : " + huh)

      this.pm.dim()
        .then(onSuccess => { this.service.fileService.presentToast("Succeeded!1" + onSuccess, 10000) })
        .catch(onError => { this.service.fileService.presentToast("Failed! 1" + onError, 10000) });

    });



  }

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49087

Trending Articles



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