Capacitor Device addListener

I need to find out when the device changes from on battery to plugged in. I can see there is a Device.addListener but I can’t find any documentation on the “event name”.

You could use the plugin capacitor-intents https://github.com/IT-MikeS/capacitor-intents :wink:

and setup Broadcast Receivers with filters,
one for android.intent.action.ACTION_POWER_CONNECTED
and one for android.intent.action.ACTION_POWER_DISCONNECTED
and on startup you can find out whether they are plugged in by (await Device.getBatteryInfo()).isCharging