Ionic 3 app drains battery


#1

My ionic 3 app (app for finding businesses in an area) tends to drain the test phones’ batteries (Samsung Galaxy S4 and iPhone 6). Even when in the background, the battery lasts only a few hours. The app has the following plugins…

cordova-admob-sdk 0.19.0 “AdMob SDK”
cordova-plugin-add-swift-support 1.7.1 “AddSwiftSupport”
cordova-plugin-admob-free 0.19.0 “Cordova AdMob Plugin”
cordova-plugin-app-version 0.1.9 “AppVersion”
cordova-plugin-camera 2.4.1 “Camera”
cordova-plugin-compat 1.2.0 “Compat”
cordova-plugin-device 1.1.7 “Device”
cordova-plugin-facebook4 3.1.0 “Facebook Connect”
cordova-plugin-firebase 2.0.5 “Google Firebase Plugin”
cordova-plugin-geolocation 4.0.1 “Geolocation”
cordova-plugin-globalization 1.0.9 “Globalization”
cordova-plugin-googleplus 5.3.2 “Google SignIn”
cordova-plugin-hockeyapp 5.1.2 “HockeyApp”
cordova-plugin-nativegeocoder 3.1.2 “NativeGeocoder”
cordova-plugin-nativestorage 2.2.2 “NativeStorage”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-splashscreen 4.1.0 “Splashscreen”
cordova-plugin-statusbar 2.4.1 “StatusBar”
cordova-plugin-stripe 1.5.3 “cordova-plugin-stripe”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-promise-polyfill 0.0.2 “cordova-promise-polyfill”
ionic-plugin-keyboard 2.2.1 “Keyboard”

Any idea how I can determine what causes it to drain the battery?
Ionic CLI version 4.3.1
Cordova CLI 8.1.2

Thanks.


#2

I would check to see if you have some code running all time.


#3

Is there a way to view some kind of event log or network log on the phone to show what’s running at any given time? Perhaps it’ll help. I do have some rxjs/Subscription listeners subscribed to on the homepage, but I unsubscribe from them in the ionViewWillLeave(){} code block.