iphone-vibrate

How to make my iphone vibrate twice when I click on a button?

喜欢而已 提交于 2020-01-13 05:00:07
问题 I search to make vibrate twice my iphone when I click on a button (like a sms alert vibration) With AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)) I obtain just one normal vibration but I want two shorts :/. 回答1: #import <AudioToolbox/AudioServices.h> AudioServicesPlayAlertSound(UInt32(kSystemSoundID_Vibrate)) This is the swift function...See this article for detailed description. 回答2: Update for iOS 10 With iOS 10, there are a few new ways to do this with minimal code.

How long does AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) last?

时间秒杀一切 提交于 2019-12-24 09:27:38
问题 I don't have access an iPhone to test on right now. Can anyone tell me how long this call makes the phone vibrate? Thanks. 回答1: This article at http://www.kimballlarsen.com/2009/12/22/how-to-make-iphone-vibrate-for-a-long-time/ states that: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) API call will produce exactly 0.4 seconds of vibration and 0.1 seconds of silence. 来源: https://stackoverflow.com/questions/3338006/how-long-does-audioservicesplaysystemsoundksystemsoundid-vibrate-last

Vibrate iPhone 6S manually like peek and pop?

 ̄綄美尐妖づ 提交于 2019-12-12 07:37:57
问题 How can I manually trigger a single click-like vibration like the ones that happen when using peek&pop, or application shortcuts? 回答1: It seems that these guys have found a way to do it for iOS 9 for phones with Taptic Engine (including the iPhone 6S). http://unifiedsense.com/development/using-taptic-engine-on-ios.html I'm not sure if it applies to iOS 8 or any other phones. They've essentially retrieved the Taptic Engine interface from UIDevice and called actuateFeedback with an integer

How to detect whether iPhone is vibrating or not?

岁酱吖の 提交于 2019-12-11 20:16:36
问题 I want to write an app that does something whenever the iPhone vibrates (receives phone call, text on vibrate mode). Is there anyway to detect whether the iPhone is vibrating (i.e. handle a "vibrate" event)? Thanks for the help! 回答1: Well i don't think so that Apple give so much liberty but still you can look here for a good discussion on this topic Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working? 回答2: No. You don't have access to any API that does this. Out

Disable Vibration iphone

左心房为你撑大大i 提交于 2019-12-11 03:22:07
问题 Is there a way to disable the vibration of iPhone programmatically? All I could find is how to enable the vibration. Basically I want to toggle the Vibration Mode through UISwitch . Can anybody help me out if there's a way to do that? 回答1: As I know you can't do this . Because apple not allowing these kind of functions . 来源: https://stackoverflow.com/questions/12589270/disable-vibration-iphone

User Notification: Custom Vibration pattern

戏子无情 提交于 2019-12-10 18:21:23
问题 Is it possible to create custom vibration pattern for the user notification alert? example, we can choose to have different audio for the user notification. Is it possible to have custom vibration pattern as well? I mean do this programmatically on iOS using swift. 回答1: For create custom vibrations in iOS. Use AudioServicesPlaySystemSoundWithVibration and AudioServicesStopSystemSound. Heart Beat Vibration Example NSMutableDictionary* pulsePatternsDict = [@{} mutableCopy]; NSMutableArray*

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 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) Is

How to add vibration to cocos2d-x 3.2 on Android and iOS devices?

余生长醉 提交于 2019-12-08 07:54:50
问题 I want to vibrate my device in one of my slider functionality, using cocos2d-x 3.2. I followed some of reference links regarding this on the official forums but I'm still stumped. Can anyone help me? 回答1: After Searching a lot , Finally i am done with my Vibrate Function in Cocos2d-x 3.2 for android. There is one Vibrator Class. Vibrator.h #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include <jni.h> #include <android/log.h> #include "platform/android/jni/JniHelper.h" #endif #define CLASS

how to set iPhone vibrate length?

我怕爱的太早我们不能终老 提交于 2019-12-08 00:57:07
问题 I'm using AudioServicesPlaySystemSound to call vibrate function: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); is there any way to set the duration of the vibrate? i know that the default duration is 0.4 seconds but i want sometimes to make the device vibrate less or more time then this. 回答1: You can use these numbers for less vibration. AudioServicesPlaySystemSound(1519); // Weak AudioServicesPlaySystemSound(1520); // Strong You can merge two-three vibration for more vibration

how to set iPhone vibrate length?

强颜欢笑 提交于 2019-12-06 09:45:51
I'm using AudioServicesPlaySystemSound to call vibrate function: AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); is there any way to set the duration of the vibrate? i know that the default duration is 0.4 seconds but i want sometimes to make the device vibrate less or more time then this. You can use these numbers for less vibration. AudioServicesPlaySystemSound(1519); // Weak AudioServicesPlaySystemSound(1520); // Strong You can merge two-three vibration for more vibration duration. I do not think its possible to alter that vibration duration.. Even if you achieve it using some library