I want to write an app that does something whenever the iPhone vibrates (receives phone call, text on vibrate mode). Is there anyway to detect whether the iPhone is vibrating (i.e. handle a "vibrate" event)? Thanks for the help!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Well i don't think so that Apple give so much liberty but still you can look here for a good discussion on this topic Detecting the iPhone's Ring / Silent / Mute switch using AVAudioPlayer not working?
回答2:
No. You don't have access to any API that does this. Out of interest, why would you want to?