I am using following method to vibrate the device

 AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);

But this vibrate for a very shor period of time can we increase this period ?

有帮助吗?

解决方案

You cannot change vibration duration with official APIs.

You could call AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); multiple times in a loop or using a NSTimer, but that is not recommended. It drains battery and the device could fall off the table.

By the way, Apple could reject your app if they consider you don't use the vibrate properly.

其他提示

Since iOS5 allows custom vibrations, I believe that a virtual contact could be created with an arbitrary vibration pattern and an iMessage sent programmatically to that contact...messy but should work to circumvent the foolish API restriction. I can see why long vibrations are not allowed, but for hap tics it would be really helpful to have something besides the standard 400ms burst of 178Hz.

i think there is no way to increase the vibrate time since .it wasting the power if we increase apple fixed as constant .

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top