iOS porting: Battery indicators, app icon, add the rest of the apps

This commit is contained in:
James Babcock committed 2026-09-07 10:18:30 -07:00
1 parent 00a5e38f75
commit e5ba7abc18
31 files changed
+501 -65

No files matched your search

+9
View File
@@ -8,6 +8,15 @@ export type PhoneBatteryState = {
};
export function readPhoneBatteryState(): PhoneBatteryState {
if (global.isIOS) {
const device = UIDevice.currentDevice
const level = device.batteryLevel
const state = device.batteryState
return {
battery: level >= 0 ? Math.round(level * 100) : null,
charging: state === UIDeviceBatteryState.Unknown ? null : state === UIDeviceBatteryState.Charging || state === UIDeviceBatteryState.Full,
}
}
if (!global.isAndroid) {
return { battery: null, charging: null };
}