From 423057cd61a5c84d003ec53ba5249a523070d15a Mon Sep 17 00:00:00 2001 From: NachoSoto Date: Tue, 27 Sep 2022 11:00:38 -0700 Subject: [PATCH] [AUTOMATIC] Release/4.13.0 (#1938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **This is an automatic release.** ### New Features * 🚨 `StoreKit 2` is now enabled by default 🚨 (#1922) via NachoSoto (@NachoSoto) * Extracted `PurchasesType` and `PurchasesSwiftType` (#1912) via NachoSoto (@NachoSoto) ### Bugfixes * `StoreKit 1`: changed result of cancelled purchases to be consistent with `StoreKit 2` (#1910) via NachoSoto (@NachoSoto) * `PaymentQueueWrapper`: handle promotional purchase requests from App Store when SK1 is disabled (#1901) via NachoSoto (@NachoSoto) ### Other Changes * Fixed iOS 12 tests (#1936) via NachoSoto (@NachoSoto) * `CacheableNetworkOperation`: fixed race condition in new test (#1932) via NachoSoto (@NachoSoto) * `BasePurchasesTests`: changed default back to SK1 (#1935) via NachoSoto (@NachoSoto) * `Logger`: refactored default `LogLevel` definition (#1934) via NachoSoto (@NachoSoto) * `AppleReceipt`: refactored declarations into nested types (#1933) via NachoSoto (@NachoSoto) * `Integration Tests`: relaunch tests when retrying failures (#1925) via NachoSoto (@NachoSoto) * `CircleCI`: downgraded release jobs to Xcode 13.x (#1927) via NachoSoto (@NachoSoto) * `ErrorUtils`: added test to verify that `PublicError`s can be `catch`'d as `ErrorCode` (#1924) via NachoSoto (@NachoSoto) * `StoreKitIntegrationTests`: print `AppleReceipt` data whenever `verifyEntitlementWentThrough` fails (#1929) via NachoSoto (@NachoSoto) * `OperationQueue`: log debug message when requests are found in cache and skipped (#1926) via NachoSoto (@NachoSoto) * `GetCustomerInfoAPI`: avoid making a request if there's any `PostReceiptDataOperation` in progress (#1911) via NachoSoto (@NachoSoto) * `PurchaseTester`: allow HTTP requests and enable setting `ProxyURL` (#1917) via NachoSoto (@NachoSoto) --- .jazzy.yaml | 4 +- .version | 2 +- CHANGELOG.latest.md | 32 ++++++++------- CHANGELOG.md | 20 +++++++++ RevenueCat.podspec | 2 +- Sources/Misc/SystemInfo.swift | 2 +- .../CommonFiles/RevenueCat-Swift.h | 41 ++++++++++++------- scripts/docs/index.html | 2 +- 8 files changed, 70 insertions(+), 35 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index a3045a66be..faf0e33600 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -2,9 +2,9 @@ clean: true author: RevenueCat author_url: https://revenuecat.com sdk: iphonesimulator -module_version: 4.13.0-SNAPSHOT +module_version: 4.13.0 github_url: https://github.com/revenuecat/purchases-ios -github_file_prefix: https://github.com/revenuecat/purchases-ios/tree/4.13.0-SNAPSHOT +github_file_prefix: https://github.com/revenuecat/purchases-ios/tree/4.13.0 output: generated_docs include: - "Sources/**/*" diff --git a/.version b/.version index d8b3fe739a..813b83b653 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -4.13.0-SNAPSHOT +4.13.0 diff --git a/CHANGELOG.latest.md b/CHANGELOG.latest.md index bcbd212c02..1edd04e97e 100644 --- a/CHANGELOG.latest.md +++ b/CHANGELOG.latest.md @@ -1,17 +1,19 @@ +### New Features +* 🚨 `StoreKit 2` is now enabled by default 🚨 (#1922) via NachoSoto (@NachoSoto) +* Extracted `PurchasesType` and `PurchasesSwiftType` (#1912) via NachoSoto (@NachoSoto) ### Bugfixes -* `Purchases.beginRefundRequest`: ensured errors are `PublicError` (#1913) via NachoSoto (@NachoSoto) -* `PurchaseTesterSwiftUI`: fixed macOS target (#1915) via NachoSoto (@NachoSoto) +* `StoreKit 1`: changed result of cancelled purchases to be consistent with `StoreKit 2` (#1910) via NachoSoto (@NachoSoto) +* `PaymentQueueWrapper`: handle promotional purchase requests from App Store when SK1 is disabled (#1901) via NachoSoto (@NachoSoto) ### Other Changes -* Fixed `tvOS` tests (#1928) via NachoSoto (@NachoSoto) -* `SnapshotTesting`: require version 1.9.0 to keep supporting iOS 12/13 tests (#1931) via NachoSoto (@NachoSoto) -* `pre-commit` hook: also verify leftover API keys in `PurchaseTester` (#1914) via NachoSoto (@NachoSoto) -* `CircleCI`: changed iOS 12/13 to use Xcode 13 (#1918) via NachoSoto (@NachoSoto) -* `PurchaseTesterSwiftUI`: removed unnecessary `UIApplicationDelegate` (#1916) via NachoSoto (@NachoSoto) -* `CircleCI`: changed all jobs to use Xcode 14 (#1909) via NachoSoto (@NachoSoto) -* `Atomic`: added unit test to verify `value`'s setter (#1905) via NachoSoto (@NachoSoto) -* `spm build` CI job: changed to release build (#1903) via NachoSoto (@NachoSoto) -* `StoreKitUnitTests`: compile on iOS 11.0+ (#1904) via NachoSoto (@NachoSoto) -* `Purchases`: only expose testing data on `DEBUG` (#1902) via NachoSoto (@NachoSoto) -* `Integration Tests`: added test to verify re-subscription behavior (#1898) via NachoSoto (@NachoSoto) -* `IntegrationTests`: simplified `testExpireSubscription` to fix flaky test (#1899) via NachoSoto (@NachoSoto) -* `Integration Tests`: actually verify that entitlement is active (#1880) via NachoSoto (@NachoSoto) +* Fixed iOS 12 tests (#1936) via NachoSoto (@NachoSoto) +* `CacheableNetworkOperation`: fixed race condition in new test (#1932) via NachoSoto (@NachoSoto) +* `BasePurchasesTests`: changed default back to SK1 (#1935) via NachoSoto (@NachoSoto) +* `Logger`: refactored default `LogLevel` definition (#1934) via NachoSoto (@NachoSoto) +* `AppleReceipt`: refactored declarations into nested types (#1933) via NachoSoto (@NachoSoto) +* `Integration Tests`: relaunch tests when retrying failures (#1925) via NachoSoto (@NachoSoto) +* `CircleCI`: downgraded release jobs to Xcode 13.x (#1927) via NachoSoto (@NachoSoto) +* `ErrorUtils`: added test to verify that `PublicError`s can be `catch`'d as `ErrorCode` (#1924) via NachoSoto (@NachoSoto) +* `StoreKitIntegrationTests`: print `AppleReceipt` data whenever `verifyEntitlementWentThrough` fails (#1929) via NachoSoto (@NachoSoto) +* `OperationQueue`: log debug message when requests are found in cache and skipped (#1926) via NachoSoto (@NachoSoto) +* `GetCustomerInfoAPI`: avoid making a request if there's any `PostReceiptDataOperation` in progress (#1911) via NachoSoto (@NachoSoto) +* `PurchaseTester`: allow HTTP requests and enable setting `ProxyURL` (#1917) via NachoSoto (@NachoSoto) \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c502433768..7368244b82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## 4.13.0 +### New Features +* 🚨 `StoreKit 2` is now enabled by default 🚨 (#1922) via NachoSoto (@NachoSoto) +* Extracted `PurchasesType` and `PurchasesSwiftType` (#1912) via NachoSoto (@NachoSoto) +### Bugfixes +* `StoreKit 1`: changed result of cancelled purchases to be consistent with `StoreKit 2` (#1910) via NachoSoto (@NachoSoto) +* `PaymentQueueWrapper`: handle promotional purchase requests from App Store when SK1 is disabled (#1901) via NachoSoto (@NachoSoto) +### Other Changes +* Fixed iOS 12 tests (#1936) via NachoSoto (@NachoSoto) +* `CacheableNetworkOperation`: fixed race condition in new test (#1932) via NachoSoto (@NachoSoto) +* `BasePurchasesTests`: changed default back to SK1 (#1935) via NachoSoto (@NachoSoto) +* `Logger`: refactored default `LogLevel` definition (#1934) via NachoSoto (@NachoSoto) +* `AppleReceipt`: refactored declarations into nested types (#1933) via NachoSoto (@NachoSoto) +* `Integration Tests`: relaunch tests when retrying failures (#1925) via NachoSoto (@NachoSoto) +* `CircleCI`: downgraded release jobs to Xcode 13.x (#1927) via NachoSoto (@NachoSoto) +* `ErrorUtils`: added test to verify that `PublicError`s can be `catch`'d as `ErrorCode` (#1924) via NachoSoto (@NachoSoto) +* `StoreKitIntegrationTests`: print `AppleReceipt` data whenever `verifyEntitlementWentThrough` fails (#1929) via NachoSoto (@NachoSoto) +* `OperationQueue`: log debug message when requests are found in cache and skipped (#1926) via NachoSoto (@NachoSoto) +* `GetCustomerInfoAPI`: avoid making a request if there's any `PostReceiptDataOperation` in progress (#1911) via NachoSoto (@NachoSoto) +* `PurchaseTester`: allow HTTP requests and enable setting `ProxyURL` (#1917) via NachoSoto (@NachoSoto) ## 4.12.1 ### Bugfixes * `Purchases.beginRefundRequest`: ensured errors are `PublicError` (#1913) via NachoSoto (@NachoSoto) diff --git a/RevenueCat.podspec b/RevenueCat.podspec index 4904059446..cc9faaf6da 100644 --- a/RevenueCat.podspec +++ b/RevenueCat.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RevenueCat" - s.version = "4.13.0-SNAPSHOT" + s.version = "4.13.0" s.summary = "Subscription and in-app-purchase backend service." s.description = <<-DESC diff --git a/Sources/Misc/SystemInfo.swift b/Sources/Misc/SystemInfo.swift index 2f14535b63..15c1b31c90 100644 --- a/Sources/Misc/SystemInfo.swift +++ b/Sources/Misc/SystemInfo.swift @@ -48,7 +48,7 @@ class SystemInfo { } static var frameworkVersion: String { - return "4.13.0-SNAPSHOT" + return "4.13.0" } static var systemVersion: String { diff --git a/Tests/InstallationTests/CommonFiles/RevenueCat-Swift.h b/Tests/InstallationTests/CommonFiles/RevenueCat-Swift.h index 1d2fc2b696..160830fa3a 100644 --- a/Tests/InstallationTests/CommonFiles/RevenueCat-Swift.h +++ b/Tests/InstallationTests/CommonFiles/RevenueCat-Swift.h @@ -601,8 +601,8 @@ SWIFT_CLASS_NAMED("Builder") /// - (RCConfigurationBuilder * _Nonnull)withUserDefaults:(NSUserDefaults * _Nonnull)userDefaults SWIFT_WARN_UNUSED_RESULT; /// Set usesStoreKit2IfAvailable. -/// \param usesStoreKit2IfAvailable opt in to using StoreKit 2 on devices that support it. -/// Purchases will be made using StoreKit 2 under the hood automatically. +/// \param usesStoreKit2IfAvailable opt out of using StoreKit 2 on devices that support it. +/// Defaults to true. /// - (RCConfigurationBuilder * _Nonnull)withUsesStoreKit2IfAvailable:(BOOL)usesStoreKit2IfAvailable SWIFT_WARN_UNUSED_RESULT; /// Set dangerousSettings. @@ -1255,6 +1255,18 @@ typedef SWIFT_ENUM_NAMED(NSInteger, RCPackageType, "PackageType", open) { RCPackageTypeWeekly = 6, }; + +SWIFT_CLASS("_TtC10RevenueCat19PaymentQueueWrapper") +@interface PaymentQueueWrapper : NSObject +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + + + +@interface PaymentQueueWrapper (SWIFT_EXTENSION(RevenueCat)) +@end + /// Enum of supported period types for an entitlement. typedef SWIFT_ENUM_NAMED(NSInteger, RCPeriodType, "PeriodType", open) { /// If the entitlement is not under an introductory or trial period. @@ -1385,6 +1397,7 @@ SWIFT_CLASS_NAMED("SignedData") @property (nonatomic, readonly, copy) NSString * _Nonnull signature; /// The UNIX time, in milliseconds, when the signature was generated. @property (nonatomic, readonly) NSInteger timestamp; +- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); @end @@ -1538,7 +1551,7 @@ SWIFT_PROTOCOL_NAMED("PurchasesType") /// Called immediately if CustomerInfo is cached. Customer info can be nil if an error occurred. /// - (void)getCustomerInfoWithCompletion:(void (^ _Nonnull)(RCCustomerInfo * _Nullable, NSError * _Nullable))completion; -/// Get latest available customer info. +/// Get latest available customer info. /// \param fetchPolicy The behavior for what to do regarding caching. /// /// \param completion A completion block called when customer info is available and not stale. @@ -2153,7 +2166,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _No - SWIFT_PROTOCOL("_TtP10RevenueCat29PurchasesOrchestratorDelegate_") @protocol PurchasesOrchestratorDelegate - (void)readyForPromotedProduct:(RCStoreProduct * _Nonnull)product purchase:(void (^ _Nonnull)(void (^ _Nonnull)(RCStoreTransaction * _Nullable, RCCustomerInfo * _Nullable, NSError * _Nullable, BOOL)))startPurchase; @@ -2253,6 +2265,7 @@ SWIFT_CLASS_NAMED("PlatformInfo") @end + @interface RCPurchases (SWIFT_EXTENSION(RevenueCat)) /// Enable debug logging. Useful for debugging issues with the lovely team @RevenueCat. SWIFT_CLASS_PROPERTY(@property (nonatomic, class) BOOL debugLogsEnabled SWIFT_DEPRECATED_MSG("use Purchases.logLevel instead");) @@ -2736,6 +2749,13 @@ typedef SWIFT_ENUM_NAMED(NSInteger, RCStoreProductType, "ProductType", open) { @property (nonatomic, readonly, copy) NSLocale * _Nonnull priceLocale SWIFT_AVAILABILITY(macos,unavailable,message="Use localizedPriceString instead") SWIFT_AVAILABILITY(watchos,unavailable,message="Use localizedPriceString instead") SWIFT_AVAILABILITY(tvos,unavailable,message="Use localizedPriceString instead") SWIFT_AVAILABILITY(ios,unavailable,message="Use localizedPriceString instead"); @end + +@interface RCStoreProduct (SWIFT_EXTENSION(RevenueCat)) +- (nonnull instancetype)initWithSk1Product:(SKProduct * _Nonnull)sk1Product; +/// Returns the SKProduct if this StoreProduct represents a StoreKit.SKProduct. +@property (nonatomic, readonly, strong) SKProduct * _Nullable sk1Product; +@end + @class NSDecimalNumber; @interface RCStoreProduct (SWIFT_EXTENSION(RevenueCat)) @@ -2762,13 +2782,6 @@ typedef SWIFT_ENUM_NAMED(NSInteger, RCStoreProductType, "ProductType", open) { @property (nonatomic, readonly, copy) NSString * _Nullable localizedIntroductoryPriceString; @end - -@interface RCStoreProduct (SWIFT_EXTENSION(RevenueCat)) -- (nonnull instancetype)initWithSk1Product:(SKProduct * _Nonnull)sk1Product; -/// Returns the SKProduct if this StoreProduct represents a StoreKit.SKProduct. -@property (nonatomic, readonly, strong) SKProduct * _Nullable sk1Product; -@end - enum RCPaymentMode : NSInteger; enum RCDiscountType : NSInteger; @@ -2926,13 +2939,13 @@ typedef SWIFT_ENUM_NAMED(NSInteger, RCSubscriptionPeriodUnit, "Unit", open) { @interface RCSubscriptionPeriod (SWIFT_EXTENSION(RevenueCat)) -/// The number of units per subscription period -@property (nonatomic, readonly) NSInteger numberOfUnits SWIFT_AVAILABILITY(macos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(watchos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(tvos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(ios,unavailable,message="'numberOfUnits' has been renamed to 'value'"); +@property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; @end @interface RCSubscriptionPeriod (SWIFT_EXTENSION(RevenueCat)) -@property (nonatomic, readonly, copy) NSString * _Nonnull debugDescription; +/// The number of units per subscription period +@property (nonatomic, readonly) NSInteger numberOfUnits SWIFT_AVAILABILITY(macos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(watchos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(tvos,unavailable,message="'numberOfUnits' has been renamed to 'value'") SWIFT_AVAILABILITY(ios,unavailable,message="'numberOfUnits' has been renamed to 'value'"); @end diff --git a/scripts/docs/index.html b/scripts/docs/index.html index d91cf3855b..2258233a4b 100644 --- a/scripts/docs/index.html +++ b/scripts/docs/index.html @@ -2,7 +2,7 @@ - +