Skip to content

Commit bbfd9e4

Browse files
1.60.40
1 parent c72eeb6 commit bbfd9e4

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed

Packages/StrongboxPurchases/Sources/StrongboxPurchases/RCStrongbox.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
//
2+
// RCStrongbox.swift
3+
// Strongbox
4+
//
5+
// Created by Alex Logan on 14/04/2025.
6+
// Copyright © 2025 Mark McGuill. All rights reserved.
7+
//
8+
19
import Foundation
210
import StoreKit
311
import RevenueCat
412

5-
// Wrapper around RevenueCat to share code for purchases across bundles
613
@objc public class RCStrongbox: NSObject {
14+
15+
16+
717
public enum ProductType: String {
818
case monthly = "monthly"
919
case yearly = "yearly"
@@ -23,8 +33,8 @@ import RevenueCat
2333
}
2434
}
2535
private static var currentOffering: Offering? = nil
26-
private static let syncInfoKey = "sync_info_key"
27-
private static let restoreKey = "restore_info_key"
36+
private static let syncInfoKey = "sync_info_key_"
37+
private static let restoreKey = "restore_info_key_"
2838
private static let defaultOfferingIdentifier = "default"
2939

3040

@@ -202,7 +212,16 @@ import RevenueCat
202212
proEntitlement.productIdentifier.contains(ProductType.lifetime.rawValue) {
203213
return true
204214
}
215+
205216

217+
if let proEntitlement = entitlements.active[Entitlement.pro.rawValue], [
218+
"com.markmcguill.strongbox.ios.iap.freetrial",
219+
"com.markmcguill.strongbox.pro"
220+
]
221+
.contains(proEntitlement.productIdentifier) {
222+
return true
223+
}
224+
206225
return false
207226
}
208227

StrongBox/ProUpgradeIAPManager.m

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,12 @@ - (BOOL)isFreeTrialAvailable {
472472
#pragma mark - Subscription Updates Handler
473473

474474
- (void)didUpdateSubscription:(BOOL)pro {
475-
slog(@"🔄 SubscriptionUpdate - didUpdateSubscription: isPro = %@", pro ? @"YES" : @"NO");
476-
477-
478-
[self.preferences setPro:pro];
475+
BOOL isPro = pro || CustomizationManager.isAProBundle;
476+
slog(@"🔄 SubscriptionUpdate - didUpdateSubscription: isPro = %@ isProBundle = %@", pro ? @"YES" : @"NO", CustomizationManager.isAProBundle ? @"YES" : @"NO");
477+
479478

479+
[self.preferences setPro:isPro];
480+
480481
if (pro) {
481482
self.preferences.numberOfEntitlementCheckFails = 0;
482483
self.preferences.appHasBeenDowngradedToFreeEdition = NO;
@@ -491,22 +492,11 @@ - (void)didUpdateSubscription:(BOOL)pro {
491492
#pragma mark - Subscription Status Notification Handler
492493

493494
- (void)subscriptionStatusChanged:(NSNotification *)notification {
494-
BOOL isPro = [notification.userInfo[@"isPro"] boolValue];
495-
495+
BOOL isPro = [notification.userInfo[@"isPro"] boolValue] || CustomizationManager.isAProBundle;
496+
496497
slog(@"🔄 Subscription status changed notification received: isPro = %@", isPro ? @"YES" : @"NO");
497-
498-
499-
[self.preferences setPro:isPro];
500-
501-
if (isPro) {
502-
self.preferences.numberOfEntitlementCheckFails = 0;
503-
self.preferences.appHasBeenDowngradedToFreeEdition = NO;
504-
}
505-
506-
507-
if (self.productsAvailableNotify) {
508-
self.productsAvailableNotify();
509-
}
498+
499+
[self didUpdateSubscription:isPro];
510500
}
511501

512502
@end

model/DatabaseAuditor.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ - (void)checkHibp {
826826
self.hibpCompletedCount = 0;
827827
828828
829-
BOOL checkForNewBreaches = self.config.checkHibp;
829+
BOOL checkForNewBreaches = self.config.checkHibpBreaches;
830830
831831
NSDate *lastChecked = self.config.lastHibpOnlineCheck;
832832
if (checkForNewBreaches && lastChecked && self.config.hibpCheckForNewBreachesIntervalSeconds > 0) {

0 commit comments

Comments
 (0)