Basically what i want to do is make the app auto-orient on tablets, and keep the app in portrait mode on phones.
I want to do this for the iOS splash screen as well, so the app to start in portrait mode on phones.
But this doesnt seem to work.
I found many threads that explain that this can be achieved by using
stage.autoOrients
and
stage.setAspectRatio
But this doesnt seem to work properly.
If i use this in the app code:
if(isTablet()) {
stage.autoOrients = true;
stage.setAspectRatio( StageAspectRatio.ANY );
}
else {
stage.autoOrients = false;
stage.setAspectRatio( StageAspectRatio.PORTRAIT );
}
and use these values in the descriptor:
<aspectRatio>any</aspectRatio>
<autoOrients>true</autoOrients>
it works correctly on iPad, but if i run the app on iPhone while holding the device in landscape mode - you can see the iOS orientation animation going on and the home bar on the iPhone X for example remains in landscape orientation.
On the other hand if i use this in the descriptor:
<aspectRatio>portrait</aspectRatio>
<autoOrients>false</autoOrients>
then it works correctly on iPhone, but on iPad it wont change the orientation to landscape if i start the app by holding the device in landscape orientation. I have to rotate the device again to force the orientation change.
Issue im having is actually same as this one:
https://forums.adobe.com/thread/1219755
but i get the same results if im debugging or not, makes no difference for me
EDIT:
seems like its an old AIR bug, i have the same issue as described here:
https://tracker.adobe.com/#/view/AIR-4198273