for shaking you need the browser plugin, there is a action called "vibrate" but i dont know if it works on ios because iam an android fanboy.
to detect shaking you must use the touch function and "compare acceleration" but i cant much help you there which parameters you should use or how to set everything up because i never try it before sry