Skip to content

Commit ee11d36

Browse files
committed
Add a feature flag to enable using URLSession in WordPressKit
1 parent 2bf06fd commit ee11d36

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

WordPress/Classes/System/WordPressAppDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate {
133133

134134
ABTest.start()
135135

136+
if FeatureFlag.useURLSession.enabled {
137+
WordPressComRestApi.useURLSession = true
138+
WordPressOrgXMLRPCApi.useURLSession = true
139+
}
140+
136141
Media.removeTemporaryData()
137142
NSItemProvider.removeTemporaryData()
138143
InteractiveNotificationsManager.shared.registerForUserNotifications()

WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ enum FeatureFlag: Int, CaseIterable {
1111
case compliancePopover
1212
case googleDomainsCard
1313
case newTabIcons
14+
case useURLSession
1415

1516
/// Returns a boolean indicating if the feature is enabled
1617
var enabled: Bool {
@@ -37,6 +38,8 @@ enum FeatureFlag: Int, CaseIterable {
3738
return false
3839
case .newTabIcons:
3940
return true
41+
case .useURLSession:
42+
return BuildConfiguration.current != .appStore
4043
}
4144
}
4245

@@ -77,6 +80,8 @@ extension FeatureFlag {
7780
return "Google Domains Promotional Card"
7881
case .newTabIcons:
7982
return "New Tab Icons"
83+
case .useURLSession:
84+
return "Use URLSession in WordPressKit (instead of Alamofire)"
8085
}
8186
}
8287
}

0 commit comments

Comments
 (0)