title: Cordova iOS iPhone X - Home indicator - Edge protection - DeferringSystemGestures?
body: <p>I'm working on a webapp built with Cordova for both iOS and Android. Everything was fine until I launched tests on the new Apple's iPhoneX. As you may know, Apple decided to remove the physical home button by replacing it by a home indicator at the bottom of the screen:</p>
  <p><a href="https://i.stack.imgur.com/g3qWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g3qWm.png" alt="iPhoneX home indicator at screen bottom" /></a></p>
  <p>This home indicator is always visible on your screen and it goes over your webapp content. When user want to navigate between apps or to go back to the home screen, he has to swip up this home indicator (which is very sensitive). This wonderful invention brought to my webapp 2 main problems:</p>
  <ol>
  <li>This break my webapp design because it goes over the content.</li>
  <li>The system gesture enter in conflict with my webapp gesture. My entire gameplay is based on drag &amp; drop and all draggable icon are at the bottom of the screen, under the home indicator.</li>
  </ol>
  <h3>1. How to hide the home indicator?</h3>
  <p>To solve the first point I found a plugin called <a href="https://www.npmjs.com/package/cordova-plugin-hide-home-indicator" rel="nofollow noreferrer">cordova-plugin-hide-home-indicator</a>. This will hide (with fadeIn/Out effect) the home indicator after a few second of inactivity. But every times a touchscreen event is detected, the home button is visible again... I have red <a href="https://medium.com/the-traveled-ios-developers-guide/iphone-x-dealing-with-home-indicator-2e8e47f5647f" rel="nofollow noreferrer">here</a> that even if the Objective C (Xcode) function <strong>prefersHomeIndicatorAutoHidden()</strong> (which I guess is used by this Cordova plugin) return <strong>true</strong> it doesn't mean that the home indicator will be hidden for ever. Well... if somebody has a better solution I would appreciate your help!</p>
  <h3>2. How to lock system gesture?</h3>
  <p>I found a Xcode function called <strong><a href="https://developer.apple.com/documentation/uikit/uiviewcontroller/2887512-preferredscreenedgesdeferringsys?language=objc" rel="nofollow noreferrer">preferredScreenEdgesDeferringSystemGestures()</a></strong> They explain that normally the system will always take precedence on an app gesture, but in some cases (for immersive games for exemple) you can ask for your app to take precedence on the system. This sounds great! But unfortunately I don't know anything of Objective C :) I didn't find any plugin about that point.</p>
  <p>In this <a href="https://developer.apple.com/videos/play/fall2017/801" rel="nofollow noreferrer">video</a> from Apple at 10:33, they talk about <strong>edge protection</strong>, which should do the trick by giving the app gesture the precedence, but again, I didn't find any plugin for Cordova...</p>
  <p>Any ideas? Thanks!</p>