gluonhq/attach

DisplayService.hasNotch() wrong on Simulator when Launched In Landscape

Opened this issue · 0 comments

Hello there,

I noticed that the DisplayService.hasNotch() Method returns an incorrect value, when fallback to screen height is used.

I only have an iPhone 7 as a Testing-Device available, which unfortunately lacks a Notch. So, instead, I am using the Simulator for testing. Interestingly, it detects the notch correctly when the App launches in Portrait Mode. But when I launch it in Landscape Mode, it does not.

This seems to be related to the Display.m file only detecting this information once and caching the result indefinitely. For the actual device this is not a problem, because up to the iPhone 14 max the Device list captures that. But for Simulator or future unknown devices this will be an issue.

I wouldn't have to rely on this information, if I could correctly query the status bar height for the device. Which unfortunately I cannot right now. So a fix would be appreciated.