starcwl
starcwl

Reputation: 406

if there other vibration method except use kSystemSoundID_Vibrate

when iPhone has a incoming call , its vibration duration seems longer than invoke the method below: AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

how could i make the vibration duration as long as the iPhone incoming call .

I make a VoIP app, I want the single time vibration duration not too short...

Upvotes: 1

Views: 838

Answers (1)

latonz
latonz

Reputation: 1750

There's no method to achieve a longer vibration. But you could repeat the vibration permanently or with a timer and a little space between the vibrations.

Example of a timer based solution:

//start the vibration
NSTimer * vibrationTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(vibrate) userInfo:nil repeats:YES];

//stop the vibration
[vibrationTimer invalidate];

-(void)vibrate{
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
}

Upvotes: 1

Related Questions