问题
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