Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

DeviceOrientationEvent in Safari (iPhone 3GS, iOS 4.2)

I'm trying to get orientation and accelaration information with Javascript. Safari with iOS 4.2 at iPhone 3GS and iPhone 4 should support both device motion and orientation APIs. However, it seems DeviceOrienationEvent is not working in Safari at iPhone 3GS + iOS 4.2. In javascript,

window.DeviceMotionEvent
window.DeviceOrientationEvent

both of these are defined, so I expect event listeners for them to work but,

window.addEventListener( "devicemotion", function( event ){ ...
window.addEventListener( "deviceorientation", function( event ) { ...

for devicemotion, this event listener works good, but not deviceorientation.

I've checked with iPhone4, and it works just fine. Both device motion listener and device orientation listener work, but not iPhone 3GS.

Is this a bug in Safari or iOS 4.2? Any idea?

Thanks.

iPhone 3G S, iOS 4

Posted on Dec 23, 2010 7:26 PM

Reply
1 reply

There are no replies.

DeviceOrientationEvent in Safari (iPhone 3GS, iOS 4.2)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.