Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

iPhone 8 / 8Plus / X support

Discussion in 'iOS and tvOS' started by Mantas-Puida, Sep 29, 2017.

Thread Status:
Not open for further replies.
  1. Maisey

    Maisey

    Joined:
    Feb 17, 2014
    Posts:
    300
    @Mantas-Puida does UnityEngine.iOS.DeviceGeneration.iPhoneX still not work (atleast not on simulator)?

    I'm using 2017.4.1f1 and to my surprise it seems you haven't fixed this issue that we've been having for 3-4 months now. Issue: https://issuetracker.unity3d.com/issues/iphone-x-has-wrong-device-enumeration
    Says it's fixed in 2018.1, but according to your new release plan, 2017.4.1 LTS should be the STABLE version and 2018.X will be TECH release. What the hell?
     
  2. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    Hi, we are looking into it. Might be that a bug fix was not backported and forgotten about.
     
  3. robertas-unity

    robertas-unity

    QA Minion Unity Technologies

    Joined:
    Mar 24, 2015
    Posts:
    28
  4. Maisey

    Maisey

    Joined:
    Feb 17, 2014
    Posts:
    300
    Thank you! Not all of us have an iPhone X at hand. :)
     
  5. jtigner-scpl

    jtigner-scpl

    Joined:
    Nov 2, 2016
    Posts:
    1
    Mantas-Puida - I am currently looking into an issue with the iPhoneX and the open source SafeAreaImpl plugin provided, that does not the expected values under the following circumstance:
    1. User is initially in landscape mode
    2. Values provided by GetSafeAreaImpl are as expected for Landscape
      1. x: 132.0, y: 63.0, width: 2172.0, height: 1062.0
    3. User initiates a login for Facebook
    4. Facebook Browser Login is displayed in Landscape
      1. iPhone FB Login 1.PNG
    5. User selects 'Open in App'
      1. iPhone FB Login 2.PNG
    6. Facebook app displays in portrait mode
      1. iPhone FB Login 3.PNG
    7. User rotates phone to portrait and provides all expected permissions
    8. Facebook app returns to the game to foreground
    9. The devices returns to Landscape mode once Unity is given focus
    10. The GetSafeAreaImpl plugin returns unexpected values
      1. x: 0.0, y: 102.0, width: 2436.0, height: 891.0
    11. Note: If the user does not rotate the phone during Step #7, then all values are as expected.
      1. x: 132.0, y: 63.0, width: 2172.0, height: 1062.0
    12. Continued attempts to query GetSafeAreaImpl do not properly refresh the values for as long as the application is run.
    Is this a known issue? Are there any solutions to ensuring that the GetSafeAreaImpl is able to retrieve the proper insets from the device in Landscape mode?

    Tech Stats:
    • iPhoneX using iOS 11.3
    • Unity 5.6.5p2
    • Build with Xcode 9.3.1
     
  6. Richardbmth

    Richardbmth

    Joined:
    Mar 5, 2016
    Posts:
    30
    Rather than create a new thread, this is query about the new iPhones coming out in relation to Unity.

    We're almost ready to submit to Apple and have done some code which if it's an DeviceGeneration.iPhoneUnknown & the resolution equals the XS, XR and XS Max, then do the iPhone X adjustments. This works in the simulator, but not entirely sure whether 2017.4.11f1 will treat the new iPhones as a DeviceGeneration.iPhoneUnknown.

    Is there an eta when do you think the DeviceGeneration enum will be updated in Unity 2017.4 LTS & 2018 ?
     
  7. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,541
    I skip the enums and test directly, that way i dont have to wait, plus im using unity5.6 so im never sure if ill get the enum updates at all in my version:

    Code (CSharp):
    1.  
    2.  
    3. deviceID = SystemInfo.deviceModel;
    4.  
    5.  
    6. // iPhone X
    7. if(deviceID == "iPhone10,3 " || deviceID == "iPhone10,6"){
    8. deviceName = "iPhone X";
    9. }
    10.  
    Model numbers are here:
    https://www.theiphonewiki.com/wiki/Models

    iphone xr : iPhone11,8
    iphone xs: iPhone11,2
    iphone xs max: iPhone11,4 and iPhone11,6
     
    Richardbmth likes this.
  8. Richardbmth

    Richardbmth

    Joined:
    Mar 5, 2016
    Posts:
    30
    @protopop huge thanks for the info! When we did the first adjustments for the iPhone X, DeviceGeneration came up in the research. I didn't know there was an alternative and good to know from anecdotal evidence it works too :)

    *skips off to try it*
     
    protopop likes this.
Thread Status:
Not open for further replies.