Meteor, detect device orientation change

439 Views Asked by At

I'm building an mobile app with Meteor. Now if the phone changes orientation, the page no longer renders correctly. So I need to refresh the page after orientation change.

Is there a way to detect the orientation change in Meteor cordova app?

Thanks.

1

There are 1 best solutions below

0
On

A good point to start is this post that actually covers both Android and iOS platforms:

Detect rotation of Android phone in the browser with JavaScript

We currently have two handlers added with window.addEventListener in Template.template_name.created. resize event is used on Android and orientationchange event is used on iOS.