iOS related, but not specific to Xojo

if you create an iOS app for an iPhone, does PortraitUpsideDown work for ANY models?
I had read that it didn’t for iPhoneX, but my (nonXojo) apps only Portrait, and LandLeft, LandRight work… Upsidedown works for iPad models

wondering if it was an iOS issue or a “me” issue

I’ve used it in the past on iPhones where a mag stripe credit card reader was needed in the headphone jack, and the headphone jacks got relocated to the bottom of the phone. I enabled PortaitUpsideDown so the device could be flipped around to put the card reader back at the top of the device. I think that was back around the iPhone 5 or 6 – don’t recall now. So yes, I know it did work on some iPhone models in the past. This predates Xojo support for iOS.

It also worked on the iPod Touch 5 and 6. In fact, still does, I just tested it. But the same app does not rotate to that on my XS Max.

It is well documented that Upside down doesnt work (by design) on the “X” models, but I can’t get it to work on anything but iPads

I can attest to the fact I have apps where it does work on my iPod Touch 6, and I added that support for some earlier phone when the headphone jack moved to the bottom. I just don’t recall now exactly when that happened. I don’t have one of those laying around anymore. But I know I had it working on those phone models at the time. This was not in Xojo, or Objective-C or Switft though. But for sure iOS did support it, as I have a couple apps which still do it on my iPod Touch 6 (and running iOS 12.1.1 too).

Well this is strange… if I tell the app the UpsideDown is the ONLY allowed orientation… it works fine on iPad still

but crashes on iPhone (all this is in simulator)

same if I set shouldAutoRotate to NO, still works on iPad :frowning:

and yes the pList is set properly

The flip modes need to be set on navigations and windows if any of them have it set to off it won’t work. I have example apps on xojo that do work bottom up on iphone XR

Safari won’t seem to do this natively.

I have all the “flags” set in the Plist, and like I said it DOES work for iPad, and isn’t supposed to work for iPhoneX family
and crashes for other iPhone models (and again it was more an iOS question than Xojo)

there are articles on the web referring to this, but nobody has a clear cut example/solution… So I don’t know if its an Xcode10 issue or not

[quote=427319:@Dave S]I have all the “flags” set in the Plist, and like I said it DOES work for iPad, and isn’t supposed to work for iPhoneX family
and crashes for other iPhone models (and again it was more an iOS question than Xojo)

there are articles on the web referring to this, but nobody has a clear cut example/solution… So I don’t know if its an Xcode10 issue or not[/quote]

Nevermind dave, iphone x models don’t support this mode by design. There are bugreports from 2017 at apple. They reported that it’s undocumented but by design.

Yes… its non-IphoneX that I’m taking about… I was aware it isn’t supposed to work for the “X-family”

All other models are supposed to work. Ipads and iphones (with a rectangular screen and home button).

[quote=427308:@Dave S]Well this is strange… if I tell the app the UpsideDown is the ONLY allowed orientation… it works fine on iPad still

but crashes on iPhone (all this is in simulator)

same if I set shouldAutoRotate to NO, still works on iPad :frowning:

and yes the pList is set properly[/quote]

That means that the flags arn’t set somehow. Perhaps a support flag in plist failing?

This may help:
https://stackoverflow.com/questions/5888016/ios-device-orientation-on-load

But it’s still odd you have it already working on ipads…

Derk… if the flags weren’t set in the pList then it would work for the iPad, and even so… would not CRASH an iPhone… it just simply would not change orientation

<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>

[quote=427327:@Dave S]Derk… if the flags weren’t set in the pList then it would work for the iPad, and even so… would not CRASH an iPhone… it just simply would not change orientation

<key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> [/quote]

Here is someone that has crashes with orientationnotifications before:

that was a different issue/crash…
my code is in fact detecting the change to upside down… it just doesn’t react.
If I tell it all orientations are valid… it just doesn’t change… if I tell it ONLY upside down is valid… it crashes

if you look above you will see the message I get… and not to repeat myself… but it works on iPad and it’s the same code…

and its not a simulator bug… I just installed on my iPod Touch, and upside down doesn’t change

My recollection of this is that unless you are hiding the status bar (like for a game), the upside-down orientation is not allowed.

That is not the case in my apps, which still rotate to UpsideDown with the status bar. At least on my iPod Touch 6. Just tried the app on an iPhone 7 Plus, and it rotated too. But not my XS Max.

But I can’t really offer advice on how to do it either – I just set the properties in my toolset that I am using. (Predates Xojo support for iOS)

it just so happens in this test, the statusbar IS hidden