2

I have a native app in iOS that load a hybrid application using a web view. The hybrid app is build in jquery and kendo.js.

I need to detect in the hybrid app if the device is the iPhone X. I don´t know if it is possible to detect the device on the native side and send a parameter to the web application side.

Thanks.

Kerberos
  • 4,036
  • 3
  • 36
  • 55
  • The easiest way for me is to append something like `?device=iphonex` to the url your are loading in the webview. It's dirty I guess – severin.julien Nov 03 '17 at 14:50
  • You can see [here](https://stackoverflow.com/questions/46192280/detect-if-the-device-is-iphone-x) to detect the iPhone X device and then you can send the bool value with a GET request (for example) – Kerberos Nov 03 '17 at 14:57
  • Possible duplicate of [Detect if the device is iPhone X](https://stackoverflow.com/questions/46192280/detect-if-the-device-is-iphone-x) – Ozgur Vatansever Nov 03 '17 at 16:19
  • While you CAN detect it natively, you can also detect it in HTML by [checking the user agent](https://stackoverflow.com/questions/46354349/iphone-x-website-safe-area) and maybe the resolition. You can also just adapt your design [using the new iPhone X CSS constants](https://www.bram.us/2017/09/14/introducing-user-agent-variables-rendering-sites-fullscreen-in-safari-on-iphone-x/). – zeh Nov 03 '17 at 20:43

0 Answers0