Detect if device is iphone x,xs,xr,xsmax

Hi there,
I have an issue regarding detecting if the current device is an iphone with a notch. It strangely does not work when i check the screen sizes (get player controler, get viewport size) when checking on a real device. I also tested the Draw viewport x and y components of the hud blueprint class, but still it does not show up any pront string for my bool. Of course i‘ve tested it using the windows viewport and that works. Is there something not working detecting screen sizes on iphone x models? Anyone any idea?

I’m running Unreal 4.22.3 so not certain if the features were available in 4.18, but here are two methods you can use to detect if you’re running on one of the iPhone X devices.

In code call the following function.
const FString DefaultDeviceProfileName = FPlatformMisc::GetDefaultDeviceProfileName();

In Blueprint call the following function.
GetActiveDeviceProfileName

The appropriate string will be returned from the function, depending on the current device.
“IPhoneX”
“IPhoneXS”
“IPhoneXSMax”
“IPhoneXR”

See the IOSDeviceNames list in following file for details.
…\ue4\Engine\Source\Runtime\Core\Public\IOS\IOSPlatformMisc.h