Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Watch Kit: is it possible to vibrate watch programmatically?

Tags:

Is it possible to vibrate watch while Watch Extension is running? We can do it on iOS in this way (force iPhone to vibrate):

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 

I hope there is something similar on WatchKit.

Update: I have added issue to Apple radar and recieved the answer:

Engineering has determined that your bug report (20019274) is a duplicate of another issue (19025053) and will be closed.

19025053 is still open.

Update 2: AudioServicesPlayAlertSound() not working on watch simulator with any sound ID. Seems like function is not supported.

like image 584
kelin Avatar asked Mar 02 '15 10:03

kelin


People also ask

How do I make my watch vibrate harder?

On the “Settings” screen, tap “Sounds & Haptics”. You'll see the volume settings on the “Sounds & Haptics” screen. Swipe up to scroll down to the haptic settings. The first thing you can do to increase the intensity of the haptic alerts is to tap the button to the right of the “Haptic Strength” indicator.

What is Haptic watch?

Sounds are audio alerts, whereas haptics are vibration alerts targeted at your wrist and arm. It is possible to configure the alert volume, adjust the haptic strength, and turn Prominent Haptic on or off, either from the Apple Watch itself, or by using the Apple Watch app on your iPhone..

Why does my watch vibrate when I cover it?

Cover to Mute is a feature that automatically places your watch into Silent Mode if you cover the display for 3 seconds straight after receiving a notification alert (such as for a text message). When Silent Mode is enabled in this way, haptic feedback is provided as confirmation.


2 Answers

You can now ask the Watch to vibrate if you target watchOS 2.0

To do this all you need to do is call playHaptic on a WKInterfaceDevice instance with any WKHapticType. In the example below it will play the notification haptic.

Swift 3

WKInterfaceDevice.current().play(.notification) 

Objective-C

[[WKInterfaceDevice currentDevice] playHaptic:WKHapticTypeNotification]; 

You can further read the Apple WKInterfaceDevice Documentation

like image 163
Ste Prescott Avatar answered Apr 05 '23 12:04

Ste Prescott


That's a great question, but unfortunately the answer is no. WatchKit doesn't have any APIs available to control haptic feedback. If you would really like to see this feature supported, I'd suggest you file a radar as a feature request.

like image 32
cnoon Avatar answered Apr 05 '23 10:04

cnoon