Search Unity

Screen UI cut off and squished when opened with app deep link in iOS 10 and 11

Discussion in 'iOS and tvOS' started by dustinkerstein, Oct 30, 2017.

  1. dustinkerstein

    dustinkerstein

    Joined:
    Jan 26, 2017
    Posts:
    16
    I've posted this as a Unity bug but they're still working on reproducing as it requires an Apple Developer Account to replicate. I wanted to see if anyone else has seen this and possibly found a workaround as it's a major showstopper for my app which is primarily driven by deep links.

    In iOS 11.0.3 (and also partially replicated in iOS 10.3.3) when an app that is configured to use only one orientation in Unity, either due to using Google Cardboard or just manually setting one orientation, is launched via an app deep link, the UI will be incorrectly positioned on the screen:





    If the app is already running in the background or if the link is clicked while the phone is in landscape orientation, this bug will not happen - though the latter depends on the specific orientation options chosen in Unity / Xcode (ie. you may only see it happen when in landscape vs. portrait - sometimes it just doesn't happen as well - it's a little fluky).

    I have tested this in Unity 2017.3.0b3, Unity 2017.3.0b5, and Unity 2017.1.2p1 on an iPhone 6+ running 11.0.3 and an iPhone 7 running 10.3.3 and 11.0.3

    Rep Steps:
    1. Create a new project and new scene with a camera.
    2. In the Player settings, set the Default Orientation to be Landscape Right.
    3. Build in Unity
    4. In Xcode, add "applinks:XYZ" to the Associated Domains in Xcode where XYZ is your deep link domain. Note you must have an Apple Developer Account and a domain to use deep linking. You can use the short domains by Firebase or Branch for testing rather than a domain you own. Build in Xcode.
    5. When the phone is in portrait and the application is not already running, click on a deep link.
    6. Note that the app will launch with the UI off screen / squished

    Depending on the phone's orientation when the deep link is clicked (and also seems a little fluky and dependent on iOS version / iPhone model) the screen may be squished / cut off in other ways than the attached image above. I've not yet tested this on an iPad, though I fear it's likely worse as rotation is much more of a core UX compared to iPhones.

    Has anyone seen this before? Any ideas on possible workarounds?
     
    zoooom and mmmlnv like this.
  2. dustinkerstein

    dustinkerstein

    Joined:
    Jan 26, 2017
    Posts:
    16
    Just a quick update - I think I may have found a workaround. In Xcode's "Orientation" setting, unchecking all of the checkboxes (Landscape Right is selected by default for me when using Google Cardboard) seems to avoid this issue. Though I have only tested it on my iPhone 6 with iOS 11.0.3. Will update with more info as I test other devices.
     
    lilymontoute and mmmlnv like this.
  3. darrensmith

    darrensmith

    Joined:
    Apr 13, 2017
    Posts:
    16
    I'm having the same problem. I'm building for iOS, and this happens on iPhone 6 and 6+ with iOS 11.1.1 (Haven't tried other models), with Unity 2017.1.2f1.

    1. App configured in Unity build settings to Landscape only.

    2. With installed app not running, hold phone vertically (i.e. in Portrait orientation.)
    3. From Gmail, click on deep link.
    4. App starts, and renders in the top half of the screen what looks like the top half of a portrait-oriented screen rotated 90 degrees (like Dustin showed in his image above.) I expected to see the display shown in landscape.
    5. Quit the app.
    6. Start the app. It starts up in landscape mode as expected (even though still holding in Portrait mode.)

    So, it seems to be tied to the deep link. I'm using Firebase for deep links.

    Any other workarounds?
     
    Last edited: Nov 16, 2017
  4. dustinkerstein

    dustinkerstein

    Joined:
    Jan 26, 2017
    Posts:
    16
    Yeah, that seems like the same issue. The only workaround I have found is unchecking all of the orientation checkboxes in Xcode before building. Though my use-case is a Google Cardboard app (which doesn't really use rotation) so I'm not sure that will help you much.
     
    max-yemelianov-viond likes this.
  5. darrensmith

    darrensmith

    Joined:
    Apr 13, 2017
    Posts:
    16
    Your suggested workaround (unchecking all of the orientation checkboxes in Xcode) seems to have solved the problem! Thank you.
     
    dustinkerstein likes this.
  6. daniel_ys

    daniel_ys

    Joined:
    Feb 13, 2017
    Posts:
    2
    For anyone getting to this thread as I did.
    Apparently this issue was solved in 2018.1 beta.
    They are also working on a backport to 2017.4 LTS as of today.