Search code examples
objective-cwatchkitapple-watchios9.2haptic-feedback

Apple Watch "do not disturb"


Is possible read the "Do not disturb" status in the Apple Watch using Objective-C? In my application I would like to avoid the haptic feedback sound if the "Do not disturb" is currently active (in the iPhone or in the watch). Thanks


Solution

  • It is not possible to read if the device is in "do not disturb". You can check the WatchKitInterfaceDevice Class Reference it does not provide any properties or functions to access that value. You would find that value in this class read the description of 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.

    This is the same for the iPhone, it does not provide that property or function. If you were to find this value it would be in UIDevice Class Reference. This class description is similar:

    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.