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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Hiding the Home Button on iPhone X on the run

Discussion in 'Editor & General Support' started by AdamLiu, Apr 18, 2018.

  1. AdamLiu

    AdamLiu

    Joined:
    Mar 19, 2014
    Posts:
    71
    Hi, I need to hide the home button on iPhone X for my game. I know there is a player setting option for that, but I prefer to change this setting on the run in the script. According to Unity documentation here, it says "Home button can be hidden on runtime by changing iOS.Device.hideHomeButton property." However, this property is in UnityEditor name space which is obviously not be accessible from the build. So I'm very confused about this. Anyone can tell me why? Thanks!
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    UnityEditor.PlayerSettings.iOS.hideHomeButton
    is for the editor player settings
    UnityEngine.iOS.Device.hideHomeButton
    is for the runtime changes
     
    AdamLiu likes this.
  3. AdamLiu

    AdamLiu

    Joined:
    Mar 19, 2014
    Posts:
    71
    Great! Thank you so much for it:)
     
  4. virendra_bhoriwal

    virendra_bhoriwal

    Joined:
    Oct 25, 2018
    Posts:
    14
    Hi
    Yes, It's working. But can we use in our project as I am afraid the app would be rejected by Apple by using above lines of code ?? Please suggest.
     
  5. AdamLiu

    AdamLiu

    Joined:
    Mar 19, 2014
    Posts:
    71
    It won't be rejected as far as I know. Because I used this in my project and Apple didn't reject it. :)
     
    virendra_bhoriwal likes this.
  6. JJunior

    JJunior

    Joined:
    May 22, 2019
    Posts:
    52
    Is this the same thing as check this option in the player settings?

    upload_2022-7-8_21-45-4.png