Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WatchKit / Apple Watch API: vibrations of custom length?

Tags:

ios

watchkit

I have a question in preparation for a potential iWatch app. Having no prior experience writing iOS apps, the API feels pretty daunting and difficult to navigate.

A central part of this project includes sending bursts of vibrations to an iWatch - is this at all possible or am I restricted to standard 'notification' vibrations? And if so, is it known at which rate one may send notifications with vibrations?

I found a possible related topic here on StackO: Are there APIs for custom vibrations in iOS? Is this approach applicable for iWatch apps?

Thank you in advance.

like image 222
aberg Avatar asked Dec 30 '14 20:12

aberg


1 Answers

Currently, there is no API for custom haptic feedback. But as of watchOS 2.0 you can invoke haptic feedback by supplying a WKHapticType option.

WKInterfaceDevice.current().play(.success)

Here are the WKHapticType options:

enum WKHapticType : Int {
    case Notification
    case DirectionUp
    case DirectionDown
    case Success
    case Failure
    case Retry
    case Start
    case Stop
    case Click
}
like image 82
hgwhittle Avatar answered Nov 15 '22 21:11

hgwhittle