Search Unity

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. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    QA is looking into your case.
     
  2. Deleted User

    Deleted User

    Guest

    Hello,
    I published some games on the app store last year, they were build by Unity 5.3+ and Xcode 7.3+, does this mean they will be letterboxed on the iphone x?
    Thank you
     
  3. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Yes, it will be letterboxed.
     
  4. noethis

    noethis

    Joined:
    Nov 11, 2013
    Posts:
    129
    Sorry to beat a dead horse, but even if my game is set up to scale to any aspect ratio you're saying on the iPhone X it will still letterbox? I just need to rebuild in XCode 9 / latest Unity to fix?
     
  5. wrutkowski

    wrutkowski

    Joined:
    Aug 9, 2017
    Posts:
    8
    Yes, you need to submit your game using Xcode 9.
     
  6. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    65
    rebuilt my game using xcode 9.1 still letterboxed in simulator any idea why ?
     
  7. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Check your launch screen settings, you should use either adaptive launch screen or fixed res (that matches iPhone X resolution) static launch image.
     
    abhijeet1001 likes this.
  8. kokonutcompany

    kokonutcompany

    Joined:
    Oct 28, 2015
    Posts:
    1
    Hi, we are using the Unity 5.6.4 p1 trying to run the game with the Xcode simulator for iPhoneX test. But, the Xcode simulator crash everytime we tried to run, but if you deploy to a device, works perfectly. Do you know if this issue is for this new update? Or is a Xcode problem?

    Thanks
     
  9. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I think it's not known problem. Please submit a bugreport.
     
  10. JimmyHo

    JimmyHo

    Joined:
    Aug 5, 2015
    Posts:
    1
    I am using Xcode 9, Unity 5.6.4f1.
    I want to show letterboxes on iPhone X.
    I found that 'show splash screen' turned off and launch screen type set to 'none' can show letterboxes, but I need launch screen.
    What can I do? Thanks.
     
    warren-miller-maltd likes this.
  11. captainfrogduh

    captainfrogduh

    Joined:
    Jul 29, 2015
    Posts:
    6
    Hi, I have updated Unity to 5.6.4p1 and trying to use if (Device.generation == DeviceGeneration.iPhoneX) but running it on the iPhone X simulator (Xcode 9.1) it looks like the if statement isn't running. I have debug logged the Device.generation separately as well and it shows Unknown. I just wanted to confirm whether this check will run properly on a physical device or not?
     
  12. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    I just got my first iPhone X review for Nimian Legends : BrightRidge and they said there was shadow flickering.

    I have experimental builds working in unity 5.6.4p1 but my core project is in Unity 5.2.2

    It's going to be very difficult to squeeze out the memory performance of 5.2. in 5.6. Is there any way at all in 5.2 i can fix the shadows on my end with a setting or code or something? My goal is to keep trying to upgrade the game successfully, but until i can manage that a backup option will help. I suspect the answer is no but it can't hurt to ask:)
     
  13. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    30
    Testing on device, there are some issues with iPhoneX:

    * Reporting Screen.dpi as 0 (5.6.4p1) which is causing havok with UI scaling
    * Reporting generation as "iPhone8Plus" rather than iPhoneX

    Have logged a bug - #966101
     
    Last edited: Nov 6, 2017
  14. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    16
    Hi,
    I just rebuilded my app to Iphone X. It is showing in letterboxing mode. Do you know how should I do to make it full screen mode? The touch input is also weird in letterboxing mode. It seems like the touch point is off and unity is not able to detect the display area in letterboxing mode. Even I touched black area in letterboxing mode, unity is reading the input. Do you know how should I resolve this error? I just want my game to display in full screen, so everything should be fine again I suppose. Thanks
     
  15. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Set iPhone Splash Screen Mode to Default.
     
  16. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    16
    Do you mind showing me how to set that? I could not find that option in Player inspector. I only see the iphone launch screen is set as default which is not working.
     
  17. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Strange. It did it for me.
     
  18. yoonack

    yoonack

    Joined:
    Apr 29, 2016
    Posts:
    16
    never mind. It works. I think it was my fault for setting resolution manually. Thanks for the help
     
  19. Exploderad

    Exploderad

    Joined:
    Oct 3, 2013
    Posts:
    5
    I have the same issue with the DeviceGeneration returning iPhone8Plus instead of iPhoneX. I tried to find your bug repport on Unity Issue tracker, but was unable to find it. Could you maybe post a link to the issue, then I can vote on the issue. Trying to work around the issue by using the SystemInfo.DeviceModel. Not pretty, but as long as it works right?
     
    protopop likes this.
  20. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    For the shadow flickering Ive had one report from iPhone 8 plus and no shadow flickering, and one iPhone X with shadow flickering.

    Since both use A11 chip I'm wondering if the shadow flickering only happens in certain circumstances? certain IOS versions perhaps? Do you guys know?
     
  21. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    I noticed somewhere Unity gave the wrong SystemInfo.DeviceModel for iPhone 8plus (cant remember where i saw it) - maybe it's wrong in the official enum and thats the issue?

    I use these numbers from the web.

    public var deviceID : String ;
    public var deviceName : String ;

    function Start () {

    deviceID = SystemInfo.deviceModel;

    // iPhone 8
    if(deviceID == "iPhone10,1" || deviceID == "iPhone10,4"){
    deviceName = "iPhone 8";
    }

    // iPhone 8 plus
    if(deviceID == "iPhone10,2 " || deviceID == "iPhone10,5"){
    deviceName = "iPhone 8 plus";
    }

    // iPhone X
    if(deviceID == "iPhone10,3 " || deviceID == "iPhone10,6"){
    deviceName = "iPhone X";
    }

    }


    I actually prefer this method because I don;t have to wait for enums and it works i older versions of unity.​
     
  22. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    30
    Apparently the device identifier issue has been merged with the DPI bug - https://issuetracker.unity3d.com/is...rn-incorrect-number-of-dpi-on-iphone-8-8-plus
     
  23. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Hi @Mantas-Puida , we have a problem with multi-line keyboard on iPhone X. The rect where the text is written starts outside the safe are making the first letters unreadable. Case 967012

    If you have any workaround for this, we would be very grateful because the only way to make it work correctly today is to do single line input, and it's not user friendly when our users are sending something through our in-game mail system and they can't format text
     
  24. SuperTung

    SuperTung

    Joined:
    Apr 27, 2017
    Posts:
    9
    hi , about the plugin "iPhone X safe area detection API"
    is there anyway i can test it without an iphone X ? (in editor , maybe ? )
    i already tested it in editor in ios platform but it get error ;)
     
  25. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    You can test it in the simulator. I recommend you use xCode 9.1, because in xCode 9, it's not usable. You will have to have a version of your project with no plugin as often, they can't run in the simulator
     
    SuperTung likes this.
  26. bangddo

    bangddo

    Joined:
    Jul 13, 2016
    Posts:
    1
    We are victims of this issue too.
     
  27. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    @sieutungbi - I've kind of faked it in my editor using the plugin provided and created a UNITY_EDITOR condition that'll allow me to set up some approximate values for the canvas size so that it'll position my assets correctly... not perfect, but its good enough to make sure I don't miss anything.

    That, and using an iPhone X semi-transparent canvas.
     
  28. Henrik-Flink

    Henrik-Flink

    Joined:
    Feb 1, 2013
    Posts:
    25
    Hey, so I'm trying to get the launch image thing correctly on the iPhone X(works correctly on all other devices).
    There are two stages to this:
    • 1) The app starts and an image is shown.
    • 2) Unity prompts it's splash screen / loading indicator phase.
    For all devices except the iPhone X the image of phase #1 is the same for phase #2, but on the iPhone X it's either a black screen or one of the other screens included in the project...

    First I thought it was some caching issue but I think Unity is trying to fetch the wrong or no image for some reason, perhaps due to reporting it to be an iPhone 8 or something as mentioned before?

    Also, this is in the simulator, I don't have an iPhone X personally so not sure if it would actually work or not on the real device.

    Any other people encountered this? This is the only thing, the rest of the game works great in the new resolution, that stands before us releasing an update for iPhone X so would be great to get a fix for this!
     
  29. PeakArt

    PeakArt

    Joined:
    Jul 25, 2017
    Posts:
    1
    Im Sorry. But i can't still figure out, one moment. Im using Unity 5.6.4, but i can't launch application on my iPhone X in full screen landscape. There are two left and right black bars and the main frame is 16:9. Is it even possible to launch Unity Application in full screen on iPhone X with 2436x1125 res ?
     
  30. Henrik-Flink

    Henrik-Flink

    Joined:
    Feb 1, 2013
    Posts:
    25
    Yes - but you have to add the appropriate launch image for iPhone X either in xcode or download the latest Unity beta - in order for it not to render the game letterboxed.
     
  31. IronKeep

    IronKeep

    Joined:
    Mar 13, 2017
    Posts:
    5
    Do you know if this works? Without actually having an iPhone X, it's hard for me to know.

    Also, you have an extra space in your iPhone 8 and iPhone X detection:
    "iPhone10,2 "
    "iPhone10,3 "

    just an FYI in case you copied that from your source.
     
    protopop likes this.
  32. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Thanks for letting me know - Ive fixed that in my code as it was a direct copy - i appreciate it:)

    I haven't tested it on iPhone X so i don't know, but i got them from the same place as my other detectors so i am assuming it is good:

    https://everymac.com/ultimate-mac-lookup/?search_keywords=iPhone10,2

    This is pretty comprehensive and you can find all the devices, including when they have Chinese variants on the same phone for example.
     
  33. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Unity 5.6.4p1 fixed the shader pink issue on my IOS 8 iPAd - thank you.

    It also runs almost as fast as unity 5.2.2 version on my devices. I feel like i am getting very close to being able to finally upgrade to Unity 5.6 from 5.2!

    Thank you:)
     
  34. IronKeep

    IronKeep

    Joined:
    Mar 13, 2017
    Posts:
    5
    I'm hoping it works too. Like you, I haven't tried it yet on an actual device yet. I've put in debug code to detect the device and it works fine on my iPhone 6 plus, but on the simulator in xcode for iPhone X it comes back with "_x86_64". I'm assuming that's just because it's the simulator and not the actual device, but it would be great to get some verification if anyone has an actual iPhone X device.

    Thanks!
     
    protopop likes this.
  35. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    One of my players has iPhone X and it returns iPhone 10,6 so i think these codes are good.
     
  36. unity_KIamTDFTsYmVag

    unity_KIamTDFTsYmVag

    Joined:
    Nov 24, 2017
    Posts:
    1
  37. SimonOliver

    SimonOliver

    Joined:
    Jul 16, 2007
    Posts:
    30
    I've updated to Unity 5.6.4p3, and great to see support for iPhoneX Splash screen there, but the trampoline code doesn't currently load this image. The following needs to be added:

    1.Device should be marked as orientable in (void)create UIWindow*)window

    Code (CSharp):
    1. _isOrientable = isIpad || (size.height == 736 || size.width == 736) || (size.height == 812 || size.width == 812);
    2.GetLaunchImageName needs the following appended:

    Code (CSharp):
    1. else if (screenSize.height == 812 || screenSize.width == 812) // iPhone X
    2.             name = @"LaunchImage~2436";
    3. GetLaunchImageFileName needs to be appended:

    Code (CSharp):
    1. else if (screenSize.height == 812 || screenSize.width == 812) // iPhoneX
    2.         {
    3.             resolutionSuffix = "-2436h";
    4.             iOSSuffix = "-1100";
    5.         }
    (Submitted as Case 972995)
     
  38. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,824
    Hi all,

    Just grabbed this patch release and I was messing with the defer system gestures option and it seems to work on the top gestures like control panel and notifications but the 'home button' at the bottom seems to still activate on the first swipe. Is that right? I guess they want that to be pretty responsive, I'm just a bit worried people will accidentally flick themselves out of a game :p

    Thanks
    Pete
     
  39. WermHat

    WermHat

    Joined:
    Jul 13, 2012
    Posts:
    88
    This isn't working for us. It still uses the splash assigned to "Mobile Splash Screen" in Unity 5.6.5. Any chance there is an extra step involved?

    Unity team- will a fix for this be coming to U5?
     
  40. -chris

    -chris

    Joined:
    Mar 1, 2012
    Posts:
    99
    With Unity 5.6.5f1, Xcode 9.2, and iPhone X Simulator,
    UnityEngine.iOS.Device.generation is reporting DeviceGeneration.Unknown instead of
    DeviceGeneration.iPhoneX.

    @protopop Your solution with SystemInfo.deviceModel should likely work. All the iPhone, iPad, and iPod model IDs are listed here: https://www.theiphonewiki.com/wiki/Models

    Simulator's SystemInfo.deviceModel just reports x86_64 unfortunately.

    For iPhone X safe area percentages, the landscape margins are roughly:
    Code (CSharp):
    1. public class IphoneX {
    2.  
    3.     public const float SideMarginPercentage = .055f;
    4.     public const float BottomMarginPercentage = .0827f;
    5.  
    6. }
     
    Last edited: Jan 13, 2018
  41. lblast

    lblast

    Joined:
    Dec 1, 2016
    Posts:
    68
    I am having an error with the plugin (https://bitbucket.org/p12tic/iossafeareasplugin):


    /Plugins/ios/SafeAreaImpl.mm:13:18: error: no visible @interface for 'UIView' declares the selector 'safeAreaInsets'
    insets = [view safeAreaInsets];
    ~~~~ ^~~~~~~~~~~~~~
    1 error generated.

    We are using Unity 5.6.3p1; but I have upgraded to the recommended 5.6.4p3 and still experience this issue.
     
  42. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Are you using latest Xcode 9.x?
     
  43. lblast

    lblast

    Joined:
    Dec 1, 2016
    Posts:
    68
    No, that was the problem. I was using XCode 8.3.3; I have moved to XCode 9.0.1 and it now works. I tried XCode 9 a few months ago but there was a problem when I made production builds because a specific image was not set and Unity didn't provide an interface to change it.

    However, I am a bit confused about the plugin; it has a canvas RectTransform variable but it never uses it?

    I've applied the plugin to several canvases and panels, but it doesn't seem to solve the problem; elements are still appearing outside of the bounds where I would expect them to be.

    I have also tried with some slightly modified code:

    Code (CSharp):
    1.     // Made these lists
    2.     public List<RectTransform> canvases; // previous plugin did not have any ref
    3.     public List<RectTransform> panels = new List<RectTransform>();
    4.     Rect lastSafeArea = Rect.zero; // changed this to shortcut
    5.  
    6.     void ApplySafeArea(Rect area)
    7.     {
    8.         var anchorMin = area.position;
    9.         var anchorMax = area.position + area.size;
    10.         anchorMin.x /= Screen.width;
    11.         anchorMin.y /= Screen.height;
    12.         anchorMax.x /= Screen.width;
    13.         anchorMax.y /= Screen.height;
    14.  
    15.         // Added this loop for canvases.
    16.         for(int i = 0; i < canvases.Count; ++i)
    17.         {
    18.             canvases[i].anchorMin = anchorMin;
    19.             canvases[i].anchorMax = anchorMax;
    20.         }
    21.  
    22.         for (int i = 0; i < panels.Count; ++i)
    23.         {
    24.             panels[i].anchorMin = anchorMin;
    25.             panels[i].anchorMax = anchorMax;
    26.         }
    27.      
    28.         lastSafeArea = area;
    29.     }
     
    Last edited: Jan 24, 2018
  44. lblast

    lblast

    Joined:
    Dec 1, 2016
    Posts:
    68
    Also, if I went back to using Unity 5.6.3p1 is it recommended that I upgrade to 5.6.4p3? We had some build issues I didn't want to have to resolve.
     
    Last edited: Jan 25, 2018
  45. chrisheinrich

    chrisheinrich

    Joined:
    Sep 27, 2017
    Posts:
    1

    @Mantas-Puida -- I am on Unity 5.6.5f1 and am still experiencing shadow flickering on iPhone X. I believe it is the same issue you referred to because it only happens on a11 gpu and if I turn off shadows it goes away. Is the Unity team aware that this is still an issue? Are there any other settings I need to adjust to fix? Please let me know. Thanks!
     
  46. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Hmm.. I think we are not aware about it. Please make a bugreport.
     
  47. jeffsherwin

    jeffsherwin

    Joined:
    Aug 22, 2014
    Posts:
    47
    I am using unity 5.6.5p2 and am getting excellent results everywhere except on iphone X. The lighting rendering is completely different on iphone X - so different as to be unusable. it is two lights a directional light and then an animated spotlight. Have searched all over and can find nothing about iphone X display rendering differently. Other iOS devices are consistent and look awesome but this iphone X rendering is potentially delaying release.

    any ideas?
     
    Last edited: Feb 23, 2018
  48. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Please report a bug with sample scene attached..
     
    jeffsherwin likes this.
  49. augzoo

    augzoo

    Joined:
    Nov 3, 2016
    Posts:
    2
    Has anyone had an issue with deviceOrientation.faceup? U have been using it for mire than a year on pre iphone 8/x without an issue.
    I realize most of the talk in this thread is about rendering, but the title says support. Also, I did start a thread fir thus several days ago, but haven't had any replies there.
    Using cloud build with latest 2017.2 and latest xcode.
     
    Last edited: Feb 27, 2018
  50. SaltwaterAssembly

    SaltwaterAssembly

    Joined:
    Mar 8, 2016
    Posts:
    95
    Hi -
    UnityEngine.iOS.DeviceGeneration.iPhoneX still not implemented?
    Thanks.
     
Thread Status:
Not open for further replies.