Skip to content

Commit

Permalink
[iOS] Bump version, hide battery level if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
kamgurgul committed Aug 12, 2024
1 parent e863598 commit e736ba6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = B6LJ2PS259;
ENABLE_PREVIEWS = YES;
Expand All @@ -369,7 +369,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -388,7 +388,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = B6LJ2PS259;
ENABLE_PREVIEWS = YES;
Expand All @@ -407,7 +407,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.2.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
PRODUCT_NAME = "${APP_NAME}";
Expand Down
4 changes: 2 additions & 2 deletions iosApp/iosApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>3</string>
<string>4</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ actual class HardwareDataProvider actual constructor() {
return buildList {
UIDevice.currentDevice.batteryMonitoringEnabled = true
add(getString(Res.string.battery) to "")
val batteryLevel = (UIDevice.currentDevice.batteryLevel * 100).round2()
add(getString(Res.string.level) to "$batteryLevel%")
val batteryLevel = UIDevice.currentDevice.batteryLevel
if (batteryLevel != -1f) {
val batteryLevelPercentage = (batteryLevel * 100).round2()
add(getString(Res.string.level) to "$batteryLevelPercentage%")
}
add(getString(Res.string.battery_state) to getBatteryState())
UIDevice.currentDevice.batteryMonitoringEnabled = false

Expand Down

0 comments on commit e736ba6

Please sign in to comment.