Skip to content

Commit e736ba6

Browse files
committed
[iOS] Bump version, hide battery level if not available
1 parent e863598 commit e736ba6

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

iosApp/iosApp.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
351351
CODE_SIGN_IDENTITY = "Apple Development";
352352
CODE_SIGN_STYLE = Automatic;
353-
CURRENT_PROJECT_VERSION = 3;
353+
CURRENT_PROJECT_VERSION = 4;
354354
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
355355
DEVELOPMENT_TEAM = B6LJ2PS259;
356356
ENABLE_PREVIEWS = YES;
@@ -369,7 +369,7 @@
369369
"$(inherited)",
370370
"@executable_path/Frameworks",
371371
);
372-
MARKETING_VERSION = 1.1.0;
372+
MARKETING_VERSION = 1.2.0;
373373
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
374374
PRODUCT_NAME = "${APP_NAME}";
375375
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -388,7 +388,7 @@
388388
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
389389
CODE_SIGN_IDENTITY = "Apple Development";
390390
CODE_SIGN_STYLE = Automatic;
391-
CURRENT_PROJECT_VERSION = 3;
391+
CURRENT_PROJECT_VERSION = 4;
392392
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
393393
DEVELOPMENT_TEAM = B6LJ2PS259;
394394
ENABLE_PREVIEWS = YES;
@@ -407,7 +407,7 @@
407407
"$(inherited)",
408408
"@executable_path/Frameworks",
409409
);
410-
MARKETING_VERSION = 1.1.0;
410+
MARKETING_VERSION = 1.2.0;
411411
ONLY_ACTIVE_ARCH = NO;
412412
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
413413
PRODUCT_NAME = "${APP_NAME}";

iosApp/iosApp/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.1.0</string>
20+
<string>1.2.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>3</string>
22+
<string>4</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UIApplicationSceneManifest</key>

shared/src/iosMain/kotlin/com/kgurgul/cpuinfo/data/provider/HardwareDataProvider.ios.kt

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ actual class HardwareDataProvider actual constructor() {
4848
return buildList {
4949
UIDevice.currentDevice.batteryMonitoringEnabled = true
5050
add(getString(Res.string.battery) to "")
51-
val batteryLevel = (UIDevice.currentDevice.batteryLevel * 100).round2()
52-
add(getString(Res.string.level) to "$batteryLevel%")
51+
val batteryLevel = UIDevice.currentDevice.batteryLevel
52+
if (batteryLevel != -1f) {
53+
val batteryLevelPercentage = (batteryLevel * 100).round2()
54+
add(getString(Res.string.level) to "$batteryLevelPercentage%")
55+
}
5356
add(getString(Res.string.battery_state) to getBatteryState())
5457
UIDevice.currentDevice.batteryMonitoringEnabled = false
5558

0 commit comments

Comments
 (0)