Skip to content

Commit

Permalink
chore!: Bump CordovaLib requirements to iOS 13+ (#1480)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue authored Aug 29, 2024
1 parent 5dede30 commit b6ae567
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 74 deletions.
2 changes: 1 addition & 1 deletion Cordova.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
s.homepage = "https://github.com/apache/cordova-ios"
s.license = { :type => "Apache 2.0", :file => "LICENSE" }
s.author = "Apache Software Foundation"
s.platform = :ios, "11.0"
s.platform = :ios, "13.0"
s.source = relSource
s.requires_arc = true
s.frameworks = ["Foundation", "UIKit", "WebKit"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,11 @@ - (WKWebViewConfiguration*) createConfigurationFromSettings:(CDVSettingsDictiona
}
configuration.applicationNameForUserAgent = userAgent;

if (@available(iOS 13.0, *)) {
NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
if ([contentMode isEqual: @"mobile"]) {
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
} else if ([contentMode isEqual: @"desktop"]) {
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
}

NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
if ([contentMode isEqual: @"mobile"]) {
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
} else if ([contentMode isEqual: @"desktop"]) {
configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
Expand Down
8 changes: 1 addition & 7 deletions CordovaLib/Classes/Public/CDVViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ Licensed to the Apache Software Foundation (ASF) under one
#import "CDVCommandDelegateImpl.h"

static UIColor* defaultBackgroundColor(void) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
return UIColor.systemBackgroundColor;
}
#endif

return UIColor.whiteColor;
return UIColor.systemBackgroundColor;
}

@interface CDVViewController () <CDVWebViewEngineConfigurationDelegate> {
Expand Down
12 changes: 5 additions & 7 deletions CordovaLib/CordovaLib.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -194,8 +194,8 @@
7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = "<group>"; };
7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
902B30732C6C5A7E00C6804C /* CordovaLib.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = CordovaLib.docc; sourceTree = "<group>"; };
902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
9036843B2C6EB06500A3338C /* CDVAllowList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVAllowList.h; sourceTree = "<group>"; };
9036843C2C6EB06500A3338C /* CDVAllowList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVAllowList.m; sourceTree = "<group>"; };
9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVURLSchemeHandler.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -521,7 +521,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1010;
LastUpgradeCheck = 1540;
TargetAttributes = {
C0C01EB11E3911D50056E6CB = {
CreatedOnToolsVersion = 10.1;
Expand Down Expand Up @@ -711,7 +711,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MERGEABLE_LIBRARY = YES;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
Expand Down Expand Up @@ -778,7 +778,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MERGEABLE_LIBRARY = YES;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
Expand All @@ -800,7 +800,6 @@
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -824,7 +823,6 @@
ENABLE_MODULE_VERIFIER = YES;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
under the License.
-->
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import PackageDescription
let package = Package(
name: "Cordova",
platforms: [
.iOS(.v11),
.iOS(.v13),
.macCatalyst(.v13)
],
products: [
Expand Down
4 changes: 2 additions & 2 deletions lib/Podfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Podfile (podFilePath, projectName, minDeploymentTarget) {

this.path = podFilePath;
this.projectName = projectName;
this.minDeploymentTarget = minDeploymentTarget || '11.0';
this.minDeploymentTarget = minDeploymentTarget || '13.0';
this.contents = null;
this.sources = null;
this.declarations = null;
Expand Down Expand Up @@ -73,7 +73,7 @@ Podfile.prototype.__parseForDeclarations = function (text) {
// split by \n
const arr = text.split('\n');

// getting lines between "platform :ios, '11.0'"" and "target 'HelloCordova'" do
// getting lines between "platform :ios, '13.0'"" and "target 'HelloCordova'" do
const declarationsPreRE = /platform :ios,\s+'[^']+'/;
const declarationsPostRE = /target\s+'[^']+'\s+do/;
const declarationRE = /^\s*[^#]/;
Expand Down
20 changes: 10 additions & 10 deletions tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
MERGED_BINARY_TYPE = automatic;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -638,7 +638,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
MERGED_BINARY_TYPE = automatic;
ONLY_ACTIVE_ARCH = NO;
Expand Down Expand Up @@ -677,7 +677,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "CordovaLibApp/CordovaLibApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = "org.apache.cordova.cordovalibapptests.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -702,7 +702,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "CordovaLibApp/CordovaLibApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
PRODUCT_BUNDLE_IDENTIFIER = "org.apache.cordova.cordovalibapptests.${PRODUCT_NAME:rfc1034identifier}";
Expand Down Expand Up @@ -736,7 +736,7 @@
"$(BUILT_PRODUCTS_DIR)/include/Cordova/**",
);
INFOPLIST_FILE = "CordovaLibTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-all_load",
Expand Down Expand Up @@ -768,7 +768,7 @@
"$(BUILT_PRODUCTS_DIR)/include/Cordova/**",
);
INFOPLIST_FILE = "CordovaLibTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-all_load",
Expand Down Expand Up @@ -800,7 +800,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/CordovaLibApp/CordovaLibApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -829,7 +829,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/CordovaLibApp/CordovaLibApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -867,7 +867,7 @@
"$(BUILT_PRODUCTS_DIR)/include/Cordova/**",
);
INFOPLIST_FILE = "CordovaLibTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-all_load",
Expand Down Expand Up @@ -899,7 +899,7 @@
"$(BUILT_PRODUCTS_DIR)/include/Cordova/**",
);
INFOPLIST_FILE = "CordovaLibTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-all_load",
Expand Down
4 changes: 0 additions & 4 deletions tests/spec/unit/fixtures/icon-support/configs/multi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="13.0" />

<icon src="res/ios/[email protected]" height="40" width="40" />
<icon src="res/ios/[email protected]" height="60" width="60" />
<icon src="res/ios/[email protected]" height="58" width="58" />
Expand Down
3 changes: 0 additions & 3 deletions tests/spec/unit/fixtures/icon-support/configs/none.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="13.0" />
</platform>

<access origin="http://*.apache.org" />
Expand Down
4 changes: 0 additions & 4 deletions tests/spec/unit/fixtures/icon-support/configs/single-only.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="13.0" />

<icon src="res/ios/appicon.png" />
</platform>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="13.0" />

<icon src="res/ios/appicon.png" foreground="res/ios/appicon-dark.png" monochrome="res/ios/appicon-tint.png" />
</platform>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
INFOPLIST_FILE = "SampleApp/SampleApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.friendstring;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -349,7 +349,7 @@
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
INFOPLIST_FILE = "SampleApp/SampleApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.example.friendstring;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="11.0" />

<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
Expand All @@ -32,4 +28,4 @@
<allow-navigation href="http://*.apache.org" />
<allow-navigation href="https://*.apache.org" />

</widget>
</widget>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="11.0" />

<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
Expand All @@ -39,4 +35,4 @@
<allow-navigation href="http://*.apache.org" />
<allow-navigation href="https://*.apache.org" />

</widget>
</widget>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="11.0" />

<splash src="res/screen/ios/Default@2x~universal~anyany.png" />
<splash src="res/screen/ios/Default@2x~universal~comany.png" />
<splash src="res/screen/ios/Default@2x~universal~comcom.png" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<content src="index.html" />

<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="11.0" />
</platform>

<access origin="http://*.apache.org" />
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/unit/fixtures/test-config-2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="11.0" />
<preference name="deployment-target" value="15.0" />
</platform>

<access origin="http://*.apache.org" />
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/unit/fixtures/test-config-3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<platform name="ios">
<preference name="orientation" value="all" />
<preference name="target-device" value="handset" />
<preference name="deployment-target" value="11.0" />
<preference name="deployment-target" value="13.0" />
<preference name="SwiftVersion" value="4.1" />
</platform>

Expand Down
2 changes: 1 addition & 1 deletion tests/spec/unit/prepare.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ describe('prepare', () => {
const proj = new XcodeProject(p.locations.pbxproj);
proj.parseSync();
const prop = proj.getBuildProperty('IPHONEOS_DEPLOYMENT_TARGET');
expect(prop).toEqual('11.0');
expect(prop).toEqual('15.0');
});
});
it('should write SwiftVersion preference (4.1)', () => {
Expand Down

0 comments on commit b6ae567

Please sign in to comment.