Developing an app that vibrates when a particular event occurs. I have a setting for turning the vibrate option ON or OFF.
I would like to be able to disable the display of the vibrate setting for devices like the iPod Touch that do not have vibrate capability. I know I can do this by determining the device model using:
UIDevice *thisDevice = [UIDevice currentDevice];
modelOfDevice = [thisDevice model];
I can then disable the Vibrate option depending on the modelOfDevice.. (i.e. not display it for iPod Touch). This works - but, I think it's bad form.. for example, if future iPod Touch devices do include Vibrate functionality, this solution would break.
So, the question.. How do I check to see if a device has the capability to vibrate??
Any suggestions appreciated. Thanks in advance.
If you just use AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) it vibrates where it can and does nothing where it cannot - just as the Apple documentation says, so you could skip the detection. The [article][1] says just can do AudioServicesPlayAlertSound(kSystemSoundID_Vibrate) to vibrate where possible or beep where not (iPod Touch still have beeping/keypress-click-sound ability)
[1]: http://blog.mugunthkumar.com/coding/iphone-tutorial-better-way-to-check-capabilities-of-ios-devices/ article
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With