문제

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