@@ -70,6 +70,7 @@ - (CDV_iOSDevice) getCurrentDevice
7070 // this is appropriate for detecting the runtime screen environment
7171 device.iPhone6 = (device.iPhone && limit == 667.0 );
7272 device.iPhone6Plus = (device.iPhone && limit == 736.0 );
73+ device.iPhoneX = (device.iPhone && limit == 812.0 );
7374
7475 return device;
7576}
@@ -100,8 +101,12 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
100101 imageName = [imageName stringByAppendingString: @" -700" ];
101102 } else if (device.iPhone6 ) {
102103 imageName = [imageName stringByAppendingString: @" -800" ];
103- } else if (device.iPhone6Plus ) {
104- imageName = [imageName stringByAppendingString: @" -800" ];
104+ } else if (device.iPhone6Plus || device.iPhoneX ) {
105+ if (device.iPhone6Plus ) {
106+ imageName = [imageName stringByAppendingString: @" -800" ];
107+ } else {
108+ imageName = [imageName stringByAppendingString: @" -1100" ];
109+ }
105110 if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown) {
106111 imageName = [imageName stringByAppendingString: @" -Portrait" ];
107112 }
@@ -115,7 +120,7 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
115120 imageName = isLandscape ? nil : [imageName stringByAppendingString: @" -568h" ];
116121 } else if (device.iPhone6 ) { // does not support landscape
117122 imageName = isLandscape ? nil : [imageName stringByAppendingString: @" -667h" ];
118- } else if (device.iPhone6Plus ) { // supports landscape
123+ } else if (device.iPhone6Plus || device. iPhoneX ) { // supports landscape
119124 if (isOrientationLocked) {
120125 imageName = [imageName stringByAppendingString: (supportsLandscape ? @" -Landscape" : @" " )];
121126 } else {
@@ -128,7 +133,11 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
128133 break ;
129134 }
130135 }
131- imageName = [imageName stringByAppendingString: @" -736h" ];
136+ if (device.iPhoneX ) {
137+ imageName = [imageName stringByAppendingString: @" -2436h" ];
138+ } else {
139+ imageName = [imageName stringByAppendingString: @" -736h" ];
140+ }
132141
133142 } else if (device.iPad ) { // supports landscape
134143 if (isOrientationLocked) {
0 commit comments