代码之家  ›  专栏  ›  技术社区  ›  gohnjanotis

从配对的iPhone确定Apple Watch电池电量

  •  3
  • gohnjanotis  · 技术社区  · 6 年前

    在Apple Watch上,我可以通过设置 WKInterfaceDevice.current().isBatteryMonitoringEnabled = true 然后检查 WKInterfaceDevice.current().batteryLevel WKInterfaceDevice.current().batteryState .

    WKInterfaceDevice.current() 对象在iOS上可用, isBatteryMonitoringEnabled , batteryLevel batteryState 属性不是。

    有没有人知道如何从iOS访问配对苹果手表的电池电量和充电状态?

    从苹果的 电池组 widget显示配对的apple watch的当前级别和充电状态,尽管这可能使用私有api,因为它是内置在ios中的widget。

    有关更多上下文,请参见 post about what I was trying to accomplish on Medium

    0 回复  |  直到 6 年前