Wondering what code in objective-c should I use to shake the iPhone continuously...
Asked
Active
Viewed 2,096 times
10
-
16This is naughty. +1 :) – BlueRaja - Danny Pflughoeft Jan 19 '10 at 15:29
-
1+1 for doing something awful to iPhone users – iandisme Jan 19 '10 at 15:33
-
7awful? I imagine it could be quite pleasant... – Ben James Jan 19 '10 at 15:37
-
This is very similar to this question: http://stackoverflow.com/questions/265761/how-do-you-make-the-iphone-vibrate-for-arbitrary-durations Note that Apple will reject your application if you do this. – Brad Larson Jan 20 '10 at 00:45
3 Answers
4
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.

Community
- 1
- 1

Daniel Vassallo
- 337,827
- 72
- 505
- 443
0
I disagree iOS 5 has implemented Custom Vibrations mode. So in some cases variable vibration is acceptable. The only thing is unknown what library deals with that (pretty sure not CoreTelephony.framework) and if it is open for developers.

Nikolay Frick
- 2,145
- 22
- 17
-3
Don't do this. Besides the fact it could get you rejected, it's simply bad form.

Ken Wootton
- 1,100
- 1
- 10
- 19