Skip to content

Commit b7e7ffd

Browse files
authored
Remove IAP as experimental feature flag option (#15799)
2 parents 0df4ab6 + 920e98b commit b7e7ffd

File tree

14 files changed

+2
-268
lines changed

14 files changed

+2
-268
lines changed

Modules/Sources/Experiments/DefaultFeatureFlagService.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
2222
return buildConfig == .localDeveloper || buildConfig == .alpha
2323
case .searchProductsBySKU:
2424
return true
25-
case .inAppPurchasesDebugMenu:
26-
return buildConfig == .localDeveloper || buildConfig == .alpha
2725
case .performanceMonitoring,
2826
.performanceMonitoringCoreData,
2927
.performanceMonitoringFileIO,

Modules/Sources/Experiments/FeatureFlag.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ public enum FeatureFlag: Int {
3434
///
3535
case searchProductsBySKU
3636

37-
/// Makes the Experimental Feature toggle for the Debug In-app purchases menu visible.
38-
/// This should not be turned on in production builds. This doesn't make any difference to the availabliity of plan purchases via IAP.
39-
///
40-
case inAppPurchasesDebugMenu
41-
4237
/// Enables Tap to Pay on iPhone flow in In-Person Payments, on eligible devices.
4338
/// This flag needs to be retained, as we cannot enable TTPoI on the Enterprise certificate,
4439
/// so `.alpha` builds must be excluded.

Modules/Sources/Storage/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ extension Storage.GeneralAppSettings {
5757
installationDate: NullableCopiableProp<Date> = .copy,
5858
feedbacks: CopiableProp<[FeedbackType: FeedbackSettings]> = .copy,
5959
isViewAddOnsSwitchEnabled: CopiableProp<Bool> = .copy,
60-
isInAppPurchasesSwitchEnabled: CopiableProp<Bool> = .copy,
6160
knownCardReaders: CopiableProp<[String]> = .copy,
6261
lastEligibilityErrorInfo: NullableCopiableProp<EligibilityErrorInfo> = .copy,
6362
lastJetpackBenefitsBannerDismissedTime: NullableCopiableProp<Date> = .copy,
@@ -69,7 +68,6 @@ extension Storage.GeneralAppSettings {
6968
let installationDate = installationDate ?? self.installationDate
7069
let feedbacks = feedbacks ?? self.feedbacks
7170
let isViewAddOnsSwitchEnabled = isViewAddOnsSwitchEnabled ?? self.isViewAddOnsSwitchEnabled
72-
let isInAppPurchasesSwitchEnabled = isInAppPurchasesSwitchEnabled ?? self.isInAppPurchasesSwitchEnabled
7371
let knownCardReaders = knownCardReaders ?? self.knownCardReaders
7472
let lastEligibilityErrorInfo = lastEligibilityErrorInfo ?? self.lastEligibilityErrorInfo
7573
let lastJetpackBenefitsBannerDismissedTime = lastJetpackBenefitsBannerDismissedTime ?? self.lastJetpackBenefitsBannerDismissedTime
@@ -82,7 +80,6 @@ extension Storage.GeneralAppSettings {
8280
installationDate: installationDate,
8381
feedbacks: feedbacks,
8482
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
85-
isInAppPurchasesSwitchEnabled: isInAppPurchasesSwitchEnabled,
8683
knownCardReaders: knownCardReaders,
8784
lastEligibilityErrorInfo: lastEligibilityErrorInfo,
8885
lastJetpackBenefitsBannerDismissedTime: lastJetpackBenefitsBannerDismissedTime,

Modules/Sources/Storage/Model/GeneralAppSettings.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
2424
///
2525
public var isViewAddOnsSwitchEnabled: Bool
2626

27-
/// The state for the In-app Purchases feature switch.
28-
///
29-
public var isInAppPurchasesSwitchEnabled: Bool
30-
3127
/// A list (possibly empty) of known card reader IDs - i.e. IDs of card readers that should be reconnected to automatically
3228
/// e.g. ["CHB204909005931"]
3329
///
@@ -59,7 +55,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
5955
public init(installationDate: Date?,
6056
feedbacks: [FeedbackType: FeedbackSettings],
6157
isViewAddOnsSwitchEnabled: Bool,
62-
isInAppPurchasesSwitchEnabled: Bool,
6358
knownCardReaders: [String],
6459
lastEligibilityErrorInfo: EligibilityErrorInfo? = nil,
6560
lastJetpackBenefitsBannerDismissedTime: Date? = nil,
@@ -74,7 +69,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
7469
self.lastEligibilityErrorInfo = lastEligibilityErrorInfo
7570
self.lastJetpackBenefitsBannerDismissedTime = lastJetpackBenefitsBannerDismissedTime
7671
self.featureAnnouncementCampaignSettings = featureAnnouncementCampaignSettings
77-
self.isInAppPurchasesSwitchEnabled = isInAppPurchasesSwitchEnabled
7872
self.sitesWithAtLeastOneIPPTransactionFinished = sitesWithAtLeastOneIPPTransactionFinished
7973
self.isEUShippingNoticeDismissed = isEUShippingNoticeDismissed
8074
self.isCustomFieldsTopBannerDismissed = isCustomFieldsTopBannerDismissed
@@ -84,7 +78,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
8478
.init(installationDate: nil,
8579
feedbacks: [:],
8680
isViewAddOnsSwitchEnabled: false,
87-
isInAppPurchasesSwitchEnabled: false,
8881
knownCardReaders: [],
8982
lastEligibilityErrorInfo: nil,
9083
featureAnnouncementCampaignSettings: [:],
@@ -114,7 +107,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
114107
installationDate: installationDate,
115108
feedbacks: updatedFeedbacks,
116109
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
117-
isInAppPurchasesSwitchEnabled: isInAppPurchasesSwitchEnabled,
118110
knownCardReaders: knownCardReaders,
119111
lastEligibilityErrorInfo: lastEligibilityErrorInfo,
120112
featureAnnouncementCampaignSettings: featureAnnouncementCampaignSettings,
@@ -135,7 +127,6 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
135127
installationDate: installationDate,
136128
feedbacks: feedbacks,
137129
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
138-
isInAppPurchasesSwitchEnabled: isInAppPurchasesSwitchEnabled,
139130
knownCardReaders: knownCardReaders,
140131
lastEligibilityErrorInfo: lastEligibilityErrorInfo,
141132
featureAnnouncementCampaignSettings: updatedSettings,
@@ -156,7 +147,6 @@ extension GeneralAppSettings {
156147
self.installationDate = try container.decodeIfPresent(Date.self, forKey: .installationDate)
157148
self.feedbacks = try container.decodeIfPresent([FeedbackType: FeedbackSettings].self, forKey: .feedbacks) ?? [:]
158149
self.isViewAddOnsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isViewAddOnsSwitchEnabled) ?? false
159-
self.isInAppPurchasesSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isInAppPurchasesSwitchEnabled) ?? false
160150
self.knownCardReaders = try container.decodeIfPresent([String].self, forKey: .knownCardReaders) ?? []
161151
self.lastEligibilityErrorInfo = try container.decodeIfPresent(EligibilityErrorInfo.self, forKey: .lastEligibilityErrorInfo)
162152
self.lastJetpackBenefitsBannerDismissedTime = try container.decodeIfPresent(Date.self, forKey: .lastJetpackBenefitsBannerDismissedTime)

Modules/Tests/StorageTests/Model/AppSettings/GeneralAppSettingsTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ final class GeneralAppSettingsTests: XCTestCase {
6666
let previousSettings = GeneralAppSettings(installationDate: installationDate,
6767
feedbacks: feedbackSettings,
6868
isViewAddOnsSwitchEnabled: true,
69-
isInAppPurchasesSwitchEnabled: false,
7069
knownCardReaders: readers,
7170
lastEligibilityErrorInfo: eligibilityInfo,
7271
lastJetpackBenefitsBannerDismissedTime: jetpackBannerDismissedDate,
@@ -103,7 +102,6 @@ private extension GeneralAppSettingsTests {
103102
func createGeneralAppSettings(installationDate: Date? = nil,
104103
feedbacks: [FeedbackType: FeedbackSettings] = [:],
105104
isViewAddOnsSwitchEnabled: Bool = false,
106-
isInAppPurchasesSwitchEnabled: Bool = false,
107105
isSwiftUIPaymentsMenuSwitchEnabled: Bool = false,
108106
knownCardReaders: [String] = [],
109107
lastEligibilityErrorInfo: EligibilityErrorInfo? = nil,
@@ -116,7 +114,6 @@ private extension GeneralAppSettingsTests {
116114
GeneralAppSettings(installationDate: installationDate,
117115
feedbacks: feedbacks,
118116
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
119-
isInAppPurchasesSwitchEnabled: isInAppPurchasesSwitchEnabled,
120117
knownCardReaders: knownCardReaders,
121118
lastEligibilityErrorInfo: lastEligibilityErrorInfo,
122119
lastJetpackBenefitsBannerDismissedTime: lastJetpackBenefitsBannerDismissedTime,

WooCommerce/Classes/Model/BetaFeature.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,27 @@ import protocol WooFoundation.WooAnalyticsEventPropertyType
55

66
enum BetaFeature: String, CaseIterable {
77
case viewAddOns
8-
case inAppPurchases
98
}
109

1110
extension BetaFeature {
1211
var title: String {
1312
switch self {
1413
case .viewAddOns:
1514
return Localization.viewAddOnsTitle
16-
case .inAppPurchases:
17-
return Localization.inAppPurchasesManagementTitle
1815
}
1916
}
2017

2118
var description: String {
2219
switch self {
2320
case .viewAddOns:
2421
return Localization.viewAddOnsDescription
25-
case .inAppPurchases:
26-
return Localization.inAppPurchasesManagementDescription
2722
}
2823
}
2924

3025
var settingsKey: WritableKeyPath<GeneralAppSettings, Bool> {
3126
switch self {
3227
case .viewAddOns:
3328
return \.isViewAddOnsSwitchEnabled
34-
case .inAppPurchases:
35-
return \.isInAppPurchasesSwitchEnabled
3629
}
3730
}
3831

@@ -42,8 +35,6 @@ extension BetaFeature {
4235
switch self {
4336
case .viewAddOns:
4437
return .settingsBetaFeaturesOrderAddOnsToggled
45-
default:
46-
return .settingsBetaFeatureToggled
4738
}
4839
}
4940

@@ -95,12 +86,5 @@ private extension BetaFeature {
9586
static let viewAddOnsDescription = NSLocalizedString(
9687
"Test out viewing Order Add-Ons as we get ready to launch",
9788
comment: "Cell description on the beta features screen to enable the order add-ons feature")
98-
99-
static let inAppPurchasesManagementTitle = NSLocalizedString(
100-
"In-app purchases",
101-
comment: "Cell title on beta features screen to enable in-app purchases")
102-
static let inAppPurchasesManagementDescription = NSLocalizedString(
103-
"Test out in-app purchases as we get ready to launch",
104-
comment: "Cell description on beta features screen to enable in-app purchases")
10589
}
10690
}

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Beta features/BetaFeaturesConfigurationViewModel.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ final class BetaFeaturesConfigurationViewModel: ObservableObject {
1515
switch betaFeature {
1616
case .viewAddOns:
1717
return true
18-
case .inAppPurchases:
19-
return featureFlagService.isFeatureFlagEnabled(.inAppPurchasesDebugMenu)
2018
}
2119
}
2220
}

WooCommerce/Classes/ViewRelated/Hub Menu/HubMenu.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ private extension HubMenu {
189189
.navigationTitle(Localization.reviews)
190190
case .coupons:
191191
couponListView
192-
case .inAppPurchase:
193-
InAppPurchasesDebugView()
194192
case .subscriptions:
195193
SubscriptionsView(viewModel: .init())
196194
case .customers:

WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewModel.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ enum HubMenuNavigationDestination: Hashable {
2626
case inbox
2727
case reviews
2828
case coupons
29-
case inAppPurchase
3029
case subscriptions
3130
case customers
3231
case reviewDetails(parcel: ProductReviewFromNoteParcel)
@@ -389,10 +388,6 @@ private extension HubMenuViewModel {
389388
items.append(Inbox())
390389
}
391390

392-
if generalAppSettings.betaFeatureEnabled(.inAppPurchases) {
393-
items.append(InAppPurchases())
394-
}
395-
396391
items.append(Customers())
397392

398393
return items
@@ -699,19 +694,6 @@ extension HubMenuViewModel {
699694
let navigationDestination: HubMenuNavigationDestination? = .reviews
700695
}
701696

702-
struct InAppPurchases: HubMenuItem {
703-
static var id = "iap"
704-
705-
let title: String = "[Debug] IAP"
706-
let description: String = "Debug your inApp Purchases"
707-
let icon: UIImage = UIImage(systemName: "ladybug.fill")!
708-
let iconColor: UIColor = .red
709-
let accessibilityIdentifier: String = "menu-iap"
710-
let trackingOption: String = "debug-iap"
711-
let iconBadge: HubMenuBadgeType? = nil
712-
let navigationDestination: HubMenuNavigationDestination? = .inAppPurchase
713-
}
714-
715697
struct PointOfSaleEntryPoint: HubMenuItem {
716698
static var id = "pointOfSale"
717699

0 commit comments

Comments
 (0)