Motion, detect orientation change


I have the following code using capacitor:

Motion.addListener('orientation', (e: MotionOrientationEventResult) => {

However when I rotate my device it’s not writing “Test”, it doesn’t enter but it does enter the first time I call it.

Does Motion (and the module it’s included in) remain in scope (i.e. not garbage collected) after you have executed that code as part of your app initialisation?

Might also be worth looking through this related topic in case the code samples and links give you any clues about what you’re doing differently to the working examples: Capacitor - Using Motion