Is it possible to trigger a haptic feedback without the accompanying sound on apple Watch OS 2

陌路散爱 提交于 2019-12-21 14:38:26

问题


Assuming the user has not muted their watch sounds. Is it possible for an apple watch app to trigger a haptic feedback (i.e vibrate) without the accompanying sound.

This is different than receiving a notification which is handled automatically by the watch. In this case I'm invoking the haptic feedback using a watch app.

like this: [[WKInterfaceDevice currentDevice] playHaptic:WKHapticTypeClick];


回答1:


There is a hacky way to do so. You can start to play WKAudioFilePlayer right before haptic and there will be no sound:

player.play()
WKInterfaceDevice.current().play(.click)

I suggest you to create a short silent (very low amplitude and high pitch) audio file for this purpose. And remember that this solution can be buggy.



来源:https://stackoverflow.com/questions/34885193/is-it-possible-to-trigger-a-haptic-feedback-without-the-accompanying-sound-on-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!