Orientation of the accelerometer axis of the iPhone-only app rotated on iPad

When I run my iPhone-portrait-only app on iPadOS15 and turn the iPad to landscape, the iPad screen rotates and the portrait iPhone app appears inside the landscape iPad screen.

This causes the orientation of the device and the app to be misaligned, resulting in a 90-degree shift in the orientation of the acceleration acquired by CMDeviceMotion. Tested on iPad6/iPadOS15.5.

Is there a way to obtain the correct acceleration for the iPhone-only app on iPad?

(other than locking the iPad screen rotation by user)

Orientation of the accelerometer axis of the iPhone-only app rotated on iPad
 
 
Q