how to set iPhone vibrate length?

2019-05-28 12:48发布

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.

3条回答
姐就是有狂的资本
2楼-- · 2019-05-28 12:50

You can use these numbers for less vibration.

AudioServicesPlaySystemSound(1519); // Weak 
AudioServicesPlaySystemSound(1520); // Strong

You can merge two-three vibration for more vibration duration.

查看更多
孤傲高冷的网名
3楼-- · 2019-05-28 13:01

You are not allowed to change the duration of vibration. If you want more you'd have to set it to start vibrating immediately after the first finishes, but Apple has been known to reject for that.

查看更多
淡お忘
4楼-- · 2019-05-28 13:09

I do not think its possible to alter that vibration duration.. Even if you achieve it using some library but I do not think Apple will be happy about that. There are chances of rejection of your App..

查看更多
登录 后发表回答