本地通知振动直到用户操作 [英] Local Notification Vibrate until user action

查看:32
本文介绍了本地通知振动直到用户操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将本地通知合并到我的应用中,以便在发生特定事件(例如闹钟)时通知用户.

目前我的本地通知有声音并且会振动.

我想要模仿时钟应用中的闹钟功能,当用户锁定手机时,它会弹出本地通知样式视图并保持振动,直到用户采取措施停止它.

这可能吗?

解决方案

没有.UILocalNotification API 允许您设置系统默认声音,选择声音,或者没有声音,如果有声音,它会在适当的情况下振动(即用户启用了振动).但除此之外,您无法控制是否发生振动或持续多长时间.

I'm incorporating Local Notifications into my app to notify the user when a certain event is happening, like an alarm.

Currently I have the Local Notification working with a sound and it vibrates.

What I'd like is to mimic the Alarm feature in the Clock app, when the user has their phone locked, it pops up a Local Notification style view and keeps vibrating until the user takes an action to stop it.

Is this possible?

解决方案

No. The UILocalNotification API lets you set the system default sound, choose a sound, or have no sound, and if you have some sound, it will vibrate under the right circumstances (i.e., the user has enabled vibration). But beyond that, you have no control over whether vibration occurs or how long it lasts.

这篇关于本地通知振动直到用户操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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