From f3d124a60f2df886973783be95fcd6a7e507d6c3 Mon Sep 17 00:00:00 2001 From: Doug Brunner Date: Wed, 29 Jan 2020 15:16:23 -0800 Subject: [PATCH] (ios) fixed no initial notification --- src/ios/CDVBattery.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ios/CDVBattery.m b/src/ios/CDVBattery.m index e2f162b..444d73d 100644 --- a/src/ios/CDVBattery.m +++ b/src/ios/CDVBattery.m @@ -112,6 +112,8 @@ - (void)start:(CDVInvokedUrlCommand*)command [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateBatteryStatus:) name:UIDeviceBatteryLevelDidChangeNotification object:nil]; } + // push out the first update immediately + [self updateBatteryStatus:nil]; } /* turn off battery monitoring */