How to get the Apple Watch hardware identifier?

蓝咒 提交于 2019-12-10 22:41:45

问题


This page http://theiphonewiki.com/wiki/Models seems to suggest that the identifiers for the new apple watches are "Watch 1,1" and "Watch 1,2"

Does anyone know how to get this identifier in code for a connected watch? [WKInterfaceDevice currentDevice] seems to only give me the screen bounds.


回答1:


There is no WatchKit method to obtain the hardware identifier. To distinguish between the 38mm and 42mm Watches, an Apple employee in the dev forums recommended using the screenBounds property on WKInterfaceDevice. Something like this:

if ([WKInterfaceDevice currentDevice].screenBounds.size.width == 136.0f) {
    // 38mm
}
else {
    // 42mm
}


来源:https://stackoverflow.com/questions/29856632/how-to-get-the-apple-watch-hardware-identifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!