watchOS 2:后台触觉反馈 [英] watchOS 2: haptic feedback in background

查看:26
本文介绍了watchOS 2:后台触觉反馈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我已经知道这个问题的答案了,但我想问的只是为了彻底.

I think I know the answer to this question already, but I wanted to ask just to be thorough.

考虑 Apple Watch 内置的地图应用.当您使用逐向导航时,当需要向左或向右转时,手表会播放自定义触觉模式 - 即使屏幕关闭且应用程序处于后台.另一个例子是当你在锻炼时——如果你设定了一个目标,当你达到 50% 和 100% 时,即使你没有看手表,你也会轻拍手腕当时(屏幕关闭,应用后台).

Consider the Apple Watch built-in Maps app. When you're using turn-by-turn directions, when it's time to turn left or right, the watch plays a custom haptic pattern - even though the screen is off and the app is backgrounded. Another example is while you're doing a workout - if you've set a goal, you'll get a light tap on your wrist when you get 50% there and 100% there, even if you're not looking at the watch at the time (screen off, app backgrounded).

在 watchOS 2 中,我们 3rd 方开发者有没有办法让应用在屏幕关闭且应用处于后台时播放特定的触觉模式?我知道 playHaptic: 方法在应用程序处于活动状态时有效,可以让您播放几种不同类型的触觉模式,而且我知道当应用程序处于非活动状态时,您可以收到通知 - 但是通知只会播放通知"触觉,别无选择.

In watchOS 2, is there any way for us 3rd party developers to have an app play a certain haptic pattern when the screen is off and the app is backgrounded? I know the playHaptic: method works while the app is active to let you play several different kinds of haptic patterns, and I know that while the app is inactive, you can have a notification come in - but the notification would only ever play the 'notification' haptic feeling, no choice in that.

推荐答案

您只能在应用处于活动状态时运行自定义代码.所以恐怕你不能这样做.

You can only run custom code when you app is active. So I´m afraid you can't do this.

这篇关于watchOS 2:后台触觉反馈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆