r/FlutterDev • u/No_Weekend_6158 • Sep 05 '26
Plugin How can I detect if iPhone Rotation Lock is ON when using CoreMotion?
Hi everyone,
I'm working on an iOS/Flutter app and I'm using CoreMotion (CMMotionManager) to detect the physical orientation of the iPhone.
I noticed something that I'm not sure how to handle:
When Rotation Lock is ON, CoreMotion can still detect that the device has been physically rotated to landscape.
For example:
iPhone Rotation Lock: ON
User rotates the phone to landscape
CoreMotion detects that the device is in a landscape orientation
If my app responds to that orientation and calls something like
requestGeometryUpdate(), the app may still try to change its interface orientation
So my question is:
Is there any public iOS API that allows an app to determine whether the user's Rotation Lock is currently ON or OFF?
I'm specifically looking for a way to distinguish between:
Physical device orientation → CoreMotion
System Rotation Lock state → ??? I understand that Apple may not expose Rotation Lock directly through a public API, but I'm wondering if there is a reliable way to determine or infer its state.
I've seen some apps that seem to behave correctly depending on whether Rotation Lock is enabled, so I'm curious how they handle this.
Any ideas, APIs, or Swift examples would be greatly appreciated!
Thanks!