So, because of the complexity of the way our projects are setup, I was not able to remove and add ios/android. I did attempt to create a fresh Cordova 3.6 project and install the new splashscreen plugin but this also did not work as expected.
I was able to solve the issue, although maybe not the best solution, this is what I did.
Inside of the iOS project's CordovaLib/CDVAvailability.h file I added two lines:
#define CDV_IsIPhone6Plus() ([[UIScreen mainScreen] bounds].size.height == 736 && [[UIScreen mainScreen] bounds].size.width == 414)
#define CDV_IsIPhone6() ([[UIScreen mainScreen] bounds].size.height == 667 && [[UIScreen mainScreen] bounds].size.width == 375)
Then inside my CDVSplashScreen.m I added changed:
if (CDV_IsIPhone5()) {
imageName = [imageName stringByAppendingString:@"-568h"];
}else if (CDV_IsIPad() && isOrientationLocked) {
switch (orientation) {
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
default:
imageName = [imageName stringByAppendingString:@"-Portrait"];
break;
}
}
To:
if (CDV_IsIPhone5()) {
imageName = [imageName stringByAppendingString:@"-568h"];
}else if(CDV_IsIPhone6Plus()){
imageName = [imageName stringByAppendingString:@"-568h"];
}else if(CDV_IsIPhone6()){
imageName = [imageName stringByAppendingString:@"-568h"];
} else if (CDV_IsIPad() && isOrientationLocked) {
switch (orientation) {
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
imageName = [imageName stringByAppendingString:@"-Landscape"];
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
default:
imageName = [imageName stringByAppendingString:@"-Portrait"];
break;
}
}
Not sure why the 568h image works correctly, but I tried specifying the 736 and 667 images, but that did not work. Simple adding those two pieces of code, now the splash screen works correctly on iPhone 6+ and 6.
Unfortunately this fix is a per project solution as it involves editing a Cordova source file.
xcode6
andcordova 3.6.3
? – Dawson Loudoncordova 3.6.3
for iOS8 – Dawson Loudon