Skip to main content
This topic has been closed for replies.

5 replies

Colin Holgate
Inspiring
July 20, 2018

I just finished an app update where one of the things we did was to support iPhone X better. I did at first use the Simulator (I want to write an article on how to get Simulator to test AIR apps on iPhone X!), but then I got a real iPhone X. That made testing quicker, as well as clearly seeing the notch.

Aside from having to create extra width on a lot of the graphics, I had the problem of placement of buttons. Up until iPhone X (and S8/S9), I was able to rely on there being no devices wider than 16:9, and so my left side buttons (this is for a landscape app) could be placed at where the left edge of a 16:9 screen would be. For iPhone X that had two problems; the button wouldn't be as far left as it could be, and in the case of a vertically centered button it would be under the notch.

Here is how I know the ratio of the screen:

var screenwidth:Number = Math.max(Capabilities.screenResolutionX, Capabilities.screenResolutionY);

var screenheight:Number = Math.min(Capabilities.screenResolutionX, Capabilities.screenResolutionY);

var screenratio:Number = screenheight / screenwidth;

I then set the left arrow button to the bottom of the screen if it's a screen as wide as iPhone X:

if(screenratio<(.562)) left_arrow.y = 455;

So, in working this way I don't have to worry about the screen size, just its ratio. It does mean that Android phones that are as wide as iPhone X (none of them are yet) would have the button sat somewhere to avoid a notch that isn't there, but it looks fine anyway.

I'm pretty sure an Android phone maker will start having notches one day!

Lars Laborious
Legend
July 21, 2018

Colin, did you ever try the Capabilities.os on a real iPhone X? Also it would be really great if you wrote that article on how to use the Simulator to test AIR apps on iPhone X  

Colin Holgate
Inspiring
July 21, 2018

I just tried (I checked the screen height too):

Without correct splash screen: iPhone OS 11.4.1 iPhone10,6 960

With correct splash screen: iPhone OS 11.4.1 iPhone10,6 2436

IGZN
Inspiring
February 18, 2018

Currently I'm using the display size to detect if it's an iPhoneX. 2436px is the height (or 812pt if you consider contentScaleFactor). All my apps look good on iPhoneX, basically you need some additional padding at the sides for the notch and the home button

Frédéric C.
Inspiring
February 16, 2018

I'd be very interested in a recapitulation of the best ways to handle this with Air please.

Especially:

- How to detect we are running on an iPhone X (capabilities or screen resolution?)

- What is the exact name of the splash screen to be packaged with the app?

pravishtis
Adobe Employee
Adobe Employee
February 19, 2018

Hi,

-Can you please check once with Capabilities.os (Capabilities - Adobe ActionScript® 3 (AS3 ) API Reference) to check for iPhone X.

-Splash screens for iPhone X need to be named as - Default-812h@3x~iphone.png(Portrait) and Default-Landscape-812h@3x~iphone.png(Landscape). For more details, please refer Launch Images on iOS with Adobe AIR​.

Thanks,

Pravishti | Adobe AIR Engineering

Frédéric C.
Inspiring
February 19, 2018

Thank you all for the tips!

I'd like to detect the iPhone model without having to use an ANE, if possible.

I checked the Capabilities.os string, with the following code:

public function isiPhoneX():Boolean

{

            var os:String;

            os = Capabilities.os;

          

            if (os.indexOf("iPhone10,3") > -1 || os.indexOf("iPhone10,6") > -1)

            {

                return (true);

            }

            else

            {

                return (false);

            }

}

However, on the iPhone X simulator, the "os" string is "iPhone OS 11 x86_64". Is it because of the simulator? If I use the code above on a real device, will it work? Thank you very much!     

Inspiring
February 16, 2018

What exactly Adobe needs to implement to support the notch on the iPhone X? That has nothing to do with Adobe. Your application needs to support it, not Adobe.

natural_criticB837
Legend
February 16, 2018

I second what chaky is saying. Our Air apps already support the iPhone X notch.

Inspiring
February 16, 2018

I don't have an Iphone X so I didn't know. I just wanted to inform the developers. If it's unnecessary, my mistake sorry.

Lars Laborious
Legend
February 16, 2018

Here's more on Apple's new demands: Submitting iOS apps to the App Store - Apple Developer