I've made a tester class to test the vibration on an iPod Touch but the vibration doesn't work when tested on the device. I've imported all relevant extensions and linked to the relevant Adobe AIR library classes as per this question and answer. Am I using a wrong callback or something?

package  
{
    import flash.display.Sprite;
    import com.adobe.nativeExtensions.Vibration; 

    public class Test extends Sprite
    {
        public function Test()
        {
            run();
        }

        public function run(): void {
            var vibe:Vibration;
            if (Vibration.isSupported)
            {
                vibe = new Vibration();
                vibe.vibrate(25000);
            }
        }
    }
}

EDIT: Found out that iPod Touches don't have vibration sensor. After testing this on an iPhone 5, it still doesn't work. As soon as the app is launched, it crashes (and closes) without vibrating.

有帮助吗?

解决方案

iPod Touch do not support vibration. :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top