苹果手表 "do not disturb"
Apple Watch "do not disturb"
是否可以使用 Objective-C 读取 Apple Watch 中的 "Do not disturb" 状态?在我的应用程序中,如果 "Do not disturb" 当前处于活动状态(在 iPhone 或手表中),我想避免触觉反馈声音。谢谢
如果设备在 "do not disturb",则无法读取。您可以检查 WatchKitInterfaceDevice Class Reference 它不提供任何属性或函数来访问该值。您会在 class 中找到该值阅读 WKInterfaceDevice 的描述:
A WKInterfaceDevice object provides information about the user’s Apple Watch. Use this information to make decisions about the content you display in your app. You can also use this object to play haptic feedback when your app is active.
这个对于iPhone也是一样的,它没有提供那个属性或者功能。如果您要找到此值,它将在 UIDevice Class Reference 中。这个class描述类似:
The UIDevice class provides a singleton instance representing the current device. From this instance you can obtain information about the device such as assigned name, device model, and operating-system name and version.
是否可以使用 Objective-C 读取 Apple Watch 中的 "Do not disturb" 状态?在我的应用程序中,如果 "Do not disturb" 当前处于活动状态(在 iPhone 或手表中),我想避免触觉反馈声音。谢谢
如果设备在 "do not disturb",则无法读取。您可以检查 WatchKitInterfaceDevice Class Reference 它不提供任何属性或函数来访问该值。您会在 class 中找到该值阅读 WKInterfaceDevice 的描述:
A WKInterfaceDevice object provides information about the user’s Apple Watch. Use this information to make decisions about the content you display in your app. You can also use this object to play haptic feedback when your app is active.
这个对于iPhone也是一样的,它没有提供那个属性或者功能。如果您要找到此值,它将在 UIDevice Class Reference 中。这个class描述类似:
The UIDevice class provides a singleton instance representing the current device. From this instance you can obtain information about the device such as assigned name, device model, and operating-system name and version.