Search Unity

Feedback Unity3d 2019.2 can't detect iPhone 11 devices

Discussion in 'iOS and tvOS' started by festival, Nov 4, 2019.

  1. festival

    festival

    Joined:
    Feb 3, 2011
    Posts:
    80
    Unity3d 2019.2 can't detect iPhone 11 devices.

    I would have expect that it detect iPhone 11 as iPhone XR because resolution is the same.
    Same for iPhone 11 Pro and iPhone 11 Pro Max.

    I like to detect ALL iPhone devices with a notch which are all devices since iPhone X and newer.

    Now I check the screen resolution as a fallback in a portrait game - maybe it#s easier now to just check for iPhone 8 models and older :)

    Code (CSharp):
    1.  
    2.  
    3.   if (Screen.width == 1125) //X and XS, iPhone11 Pro
    4.                 return true;
    5.             else if (Screen.width == 828) //XR, iPhone 11
    6.                 return true;
    7.             else if (Screen.width == 1242 &&Screen.height ==2688 )//XS max, iPhone11 Pro Max
    8.                 return true;
    9.           else
    10.          return false;
    11.