Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5219] iPhone X detection

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusResolved
ResolutionDone
Resolution Date2017-09-21T07:32:03.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterSebastian Klaus
AssigneeHans Knöchel
Created2017-09-21T06:43:56.000+0000
Updated2017-09-21T10:22:08.000+0000

Description

We need to detect use of an iPhone X. Or is it possible now?

Comments

  1. Hans Knöchel 2017-09-21

       function isiPhoneX() {
         return (Ti.Platform.displayCaps.platformWidth === 375 && Ti.Platform.displayCaps.platformHeight == 812) || // Portrait
                (Ti.Platform.displayCaps.platformHeight === 812 && Ti.Platform.displayCaps.platformWidth == 375); // Landscape
       }
       
       Ti.API.info('Is iPhone X: ' + isiPhoneX());
       
  2. Sebastian Klaus 2017-09-21

    I tried that before, but with 667. 667 is what I'm getting when I compile an older project with 6.3.X. And this appears to me like that: https://cl.ly/1b1U0p0I121p
  3. Hans Knöchel 2017-09-21

    The issue is that your launch-screens need to match the new sizes. If you are using storyboards, it will adapt automatically, for the old legacy launch-images, you will need to wait until Apple unblocks TIMOB-25269.
  4. Sebastian Klaus 2017-09-21

    Thanks!

JSON Source