Screen.safeArea is broken on iPhone XS Max under 2018.2.18

I don’t know how far back this goes in terms of versions, but this was working on 2018.2.12. I’ve just built on an iPhone XS Max and logged Screen.safeArea and I get the screen resolution… not the safe area:
(x:0.00, y:0.00, width:2688.00, height:1242.00)

safe area for this device should be reported as:
(x:132.00, y:63.00, width:2424.00, height:1179.00)

iPhone XR also doesn’t work as expected.

So annoying that these safe area values are not reliable, it’s potentially cost us featuring opportunities. I’ve also had mixed issues with the safe area on iPhone 7 Plus where the screen resolution reports as 1920x1080, yet the safe area comes back as ( 0f, 0f, 2208f, 1242f ) which is a higher resolution than the reported screen res making it unusable for any kind of dynamic safe area handling solution. I recall that there was some odd resolution handling with the iPhone 7 which is why it comes back as 1920x1080, but if you adjust the reported resolution for the 7 plus can you please adjust the safe area to match or provide some better examples on how we should handle this problem.

The only reliable solution currently is to hard code safe area values, but this is not going to be an option for android. There’s dozens of devices now with notches that we’re stuck on rolling out a solution for.

1 Like

I just noticed that changing quality is also an issue now because unity is returning a safe area as x:0.00, y:0.00, width:0.00, height:0.00 for a frame, this completely broke my “auto adjusting script” in a way I haven’t discovered yet why…

I had this issue only on startup even on Unity 2017.4, but “fixed” it by checking the safe area on update. Check the script I use here or the Unity Forum post about it here .