Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to vibrate an iPhone ad infinitum

Wondering what code in objective-c should I use to shake the iPhone continuously...

like image 946
geejay Avatar asked Jan 19 '10 15:01

geejay


People also ask

Can you ping an iPhone on vibrate?

Find My iPhone Feature And if you already know its somewhere in your home itself, then all you need to do is tap on the dot on your iPhone. A box will then come up on your screen with three options—click on the 'play sound' option. This will enable your phone to ping loudly, even if its on vibrate or silent.


1 Answers

You may want to use the code from "How do you make the iPhone vibrate for arbitrary durations?":

extern void * _CTServerConnectionCreate( CFAllocatorRef, int (*)(void *, CFStringRef, CFDictionaryRef, void *), int *);
extern int _CTServerConnectionSetVibratorState(int *, void *, int, int, float, float, float);

// Initialize
connection = _CTServerConnectionCreate(kCFAllocatorDefault, &vibratecallback, &x);

// Start Vibration
_CTServerConnectionSetVibratorState(&x, connection, 3, intensity, 0, 0, 0);

// End Vibration
_CTServerConnectionSetVibratorState(&x, connection, 0, 0, 0, 0, 0);

I bet this will make it quite difficult for your application to get approved for AppStore! Check out the Unofficial App Store Rejection Criteria.

like image 185
Daniel Vassallo Avatar answered Sep 22 '22 19:09

Daniel Vassallo