iOS-本地通知-自定义振动或振动时间更长 [英] iOS - local notification - custom vibration or vibrate for longer duration

查看:235
本文介绍了iOS-本地通知-自定义振动或振动时间更长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个像闹钟一样工作的iPhone应用程序,我正在使用UILocalNotification

I am trying to build an iPhone app that works like an alarm, I am using UILocalNotification

问题

  • 我希望手机振动更长的时间.但是目前它仅振动一次.

替代方法

  1. 是否可以使用自定义振动模式?(http://www.pcworld.com/article/242238/how_to_use_custom_vibrations_in_ios_5.html)

  1. Is it possible to use custom vibration patters ?(http://www.pcworld.com/article/242238/how_to_use_custom_vibrations_in_ios_5.html)

当推送通知被触发时,是否可以执行一个方法?(但该应用程序甚至可能尚未运行,但仍需要运行)

Is it possible to execute a method, when the push notification is fired ? (but the app might not even be running, and yet it needs to work)

NSTimer是一个选择吗?(但该应用程序甚至可能尚未运行,但仍需要运行)

Is NSTimer an option ? (but the app might not even be running, and yet it needs to work)

还有其他替代方法吗?

推荐答案

您不能更改振动的持续时间,也不能使其振动,例如,振动几次(直到您不发出多个通知).

You cannot change the duration of vibration,or make it,for example,vibrate several times(untill you don't make several notifications).

进行自定义振动的唯一方法是在应用程序运行时对其进行操作,没有其他方法适合您.

Only way to make custom vibration is to do it from the app, while it is running, no other way for you.

这篇关于iOS-本地通知-自定义振动或振动时间更长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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