3

I want to make an app where while the user is pushing down a button the phone vibrates until the user releases the button.

Ive searched around and I haven't found a way to make it a long vibrate, except for a very old tutorial from 2009 which seems to be outdated.

Priyank Gandhi
  • 1,257
  • 1
  • 16
  • 29
Arbitur
  • 38,684
  • 22
  • 91
  • 128
  • 2
    Have you tried the tutorial you found, it still might work. – rckoenes Apr 03 '14 at 11:34
  • Yea but people in the comments of it say its bugging or something, and that Apple is not accepting that method. Link to the tutorial: http://www.kimballlarsen.com/2009/12/22/how-to-make-iphone-vibrate-for-a-long-time/ – Arbitur Apr 03 '14 at 11:44

3 Answers3

3

It's not allowed by Apple to use the vibration as you want to:

Vibration. It is not permitted to use continuous vibration in your apps – short bursts as warnings is all that is allowed. Don’t bother trying to set up a timer to keep the vibration going, it will cause your app to be rejected.

It's not the method, but the result, that's not permitted.

Source: http://10base-t.com/unofficial-appstore-rejection-criteria/

lootsch
  • 1,867
  • 13
  • 21
0
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

repeat this line in between you start-stop vibrate. don't forgot to add and import

#import <AudioToolbox/AudioToolbox.h> 

framework to your project.

0

Look on these options,

1) AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
2) AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

also
Making the iPhone vibrate

And, you need to import AudioToolBox framework,

 #import <AudioToolbox/AudioServices.h>
Community
  • 1
  • 1
Ramdhas
  • 1,765
  • 1
  • 18
  • 26