iOS - local notification - custom vibration or vibrate for longer duration

夙愿已清 提交于 2019-12-10 14:59:56

问题


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

Problem

  • I would like the phone to vibrate for a longer duration. However currently it vibrates only once.

Alternative Approaches

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

  2. 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)

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

  4. Is there any other alternate ?


回答1:


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.



来源:https://stackoverflow.com/questions/10110235/ios-local-notification-custom-vibration-or-vibrate-for-longer-duration

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