Releases: RevenueCat/purchases-ios
4.25.0
New Features
Trusted Entitlements
: (#2621) via NachoSoto (@NachoSoto)
This new feature prevents MitM attacks between the SDK and the RevenueCat server.
With verification enabled, the SDK ensures that the response created by the server was not modified by a third-party, and the entitlements received are exactly what was sent.
This is 100% opt-in. EntitlementInfos
have a new VerificationResult
property, which will indicate the validity of the responses when this feature is enabled.
let purchases = Purchases.configure(
with: Configuration
.builder(withAPIKey: "")
.with(entitlementVerificationMode: .informational)
)
let customerInfo = try await purchases.customerInfo()
if !customerInfo.entitlements.verification.isVerified {
print("Entitlements could not be verified")
}
You can learn more from the documentation.
Other Changes
TrustedEntitlements
: newVerificationResult.isVerified
(#2788) via NachoSoto (@NachoSoto)Refactor
: extractedCollection.subscript(safe:)
(#2779) via NachoSoto (@NachoSoto)Trusted Entitlements
: added link to docs inErrorCode.signatureVerificationFailed
(#2783) via NachoSoto (@NachoSoto)Trusted Entitlements
: improved documentation (#2782) via NachoSoto (@NachoSoto)Tests
: fixed flaky failure with asynchronous check (#2777) via NachoSoto (@NachoSoto)Integration Tests
: re-enable signature verification tests (#2744) via NachoSoto (@NachoSoto)CI
: removeJazzy
(#2775) via NachoSoto (@NachoSoto)Signing
: injectClockType
to ensure hardcoded signatures don't fail when intermediate key expires (#2771) via NachoSoto (@NachoSoto)
4.24.1
Bugfixes
PurchasesDiagnostics
: don't test signature verification if it's disabled (#2757) via NachoSoto (@NachoSoto)
Other Changes
AnyEncodable
: also implementDecodable
(#2769) via NachoSoto (@NachoSoto)Trusted Entitlements
: log signature errors on requests with.informational
mode (#2751) via NachoSoto (@NachoSoto)Tests
: optimized several tests (#2754) via NachoSoto (@NachoSoto)SimpleApp
: allow HTTP traffic (#2763) via NachoSoto (@NachoSoto)Trusted Entitlements
: added support for unauthenticated endpoints (#2761) via NachoSoto (@NachoSoto)Integration Tests
:TestLogHandler
no longer crashes tests (#2760) via NachoSoto (@NachoSoto)SimpleApp
: changed bundle identifier (#2759) via NachoSoto (@NachoSoto)Testing
: add newSimpleApp
(#2756) via NachoSoto (@NachoSoto)Trusted Entitlements
: update handling of escaped URLs (#2758) via NachoSoto (@NachoSoto)Trusted Entitlements
: produce verification failures for static endpoints with no signature (#2752) via NachoSoto (@NachoSoto)Trusted Entitlements
: added tests to verify offerings and product entitlement mapping (#2667) via NachoSoto (@NachoSoto)Integration Tests
: refactored expiration detection (#2700) via NachoSoto (@NachoSoto)Trusted Entitlements
: add API key andHTTPRequest.Path
to signature (#2746) via NachoSoto (@NachoSoto)HTTPRequest.Path
: escapeappUserID
(#2747) via NachoSoto (@NachoSoto)Documentation
: add reference toTestStoreProduct
(#2743) via NachoSoto (@NachoSoto)PostReceiptDataOperation
: add newtestReceiptIdentifier
parameter (#2749) via NachoSoto (@NachoSoto)Integration Tests
: updated load-shedder offerings snapshot (#2748) via NachoSoto (@NachoSoto)Signing
: extract and verify intermediate key (#2715) via NachoSoto (@NachoSoto)Trusted Entitlements
: update handling of 304 responses (#2698) via NachoSoto (@NachoSoto)Trusted Entitlements
: new Signature format (#2679) via NachoSoto (@NachoSoto)Integration Tests
: avoid crashes when stopping tests early (#2741) via NachoSoto (@NachoSoto)
4.24.0
New Features
- New
TestStoreProduct
for creating mockStoreProduct
s andOffering
s (#2711) via NachoSoto (@NachoSoto)
✨ With this new API you can now create fake products for unit tests and SwiftUI previews! 🎉
Example:
let product = TestStoreProduct(
localizedTitle: "PRO monthly",
price: 3.99,
localizedPriceString: "$3.99",
productIdentifier: "com.revenuecat.product",
productType: .autoRenewableSubscription,
localizedDescription: "Description",
subscriptionGroupIdentifier: "group",
subscriptionPeriod: .init(value: 1, unit: .month)
)
let offering = Offering(
identifier: "offering",
serverDescription: "Main offering",
metadata: [:],
availablePackages: [
.init(
identifier: "monthly",
packageType: .monthly,
storeProduct: product.toStoreProduct(),
offeringIdentifier: offering
)
]
)
Dependency Updates
- Bump fastlane-plugin-revenuecat_internal from
13773d2
tob2108fb
(#2706) via dependabot[bot] (@dependabot[bot])
Other Changes
VerificationResult: CustomDebugStringConvertible
(#2739) via NachoSoto (@NachoSoto)- Refactor: simplified
PurchasesOrchestrator.syncPurchases
(#2731) via NachoSoto (@NachoSoto) Trusted Entitlements
: add integration tests to verifyCustomerInfo
cache invalidation (#2730) via NachoSoto (@NachoSoto)SystemInfo.identifierForVendor
: add tests (#2732) via NachoSoto (@NachoSoto)Tests
: disablediOS 11.x
tests to fixXcode 15
tests (#2720) via NachoSoto (@NachoSoto)DebugViewSwiftUITests
: create separate snapshots for each OS version (#2721) via NachoSoto (@NachoSoto)Integration Tests
: fix clearingUserDefaults
before each test (#2719) via NachoSoto (@NachoSoto)- Remove unused
Signing.loadPublicKey(with:)
(#2714) via NachoSoto (@NachoSoto) - Add
UInt32(littleEndian32Bits:)
andUInt32.littleEndianData
(#2713) via NachoSoto (@NachoSoto) TimingUtil
: added synchronous API (#2716) via NachoSoto (@NachoSoto)XCFramework
: sign archive forXcode 15
(#2709) via NachoSoto (@NachoSoto)CI
: removedcarthage_archive
fromrelease
lane (#2710) via NachoSoto (@NachoSoto)PriceFormatterProvider.priceFormatterForSK2
: enable on all versions (#2712) via NachoSoto (@NachoSoto)xrOS
: add support fordebugRevenueCatOverlay
(#2702) via NachoSoto (@NachoSoto)- Refactor method to get product ID including plan ID in android purchases (#2708) via Toni Rico (@tonidero)
Purchases.restoreLogHandler
(#2699) via NachoSoto (@NachoSoto)- Remove alpha from purchase tester icon to upload to testflight (#2705) via Toni Rico (@tonidero)
4.23.1
Bugfixes
Other Changes
PurchaseTester
: fixedwatchOS
build and ASC deployment (#2701) via NachoSoto (@NachoSoto)- Add
Data.sha1
(#2696) via NachoSoto (@NachoSoto) - Refactor: extract
ErrorResponse
into its own file (#2697) via NachoSoto (@NachoSoto) - Add
Sequence<AdditiveArithmetic>.sum()
(#2694) via NachoSoto (@NachoSoto) - Refactored
Data.asString
implementation (#2695) via NachoSoto (@NachoSoto) Diagnostics
: newFileHandler
for abstracting file operations (#2673) via NachoSoto (@NachoSoto)
4.23.0
This release is compatible with Xcode 15 beta 2
and visionOS beta 1
New Features
xrOS
: added to list of supported platforms (#2682) via NachoSoto (@NachoSoto)
Bugfixes
xrOS
: fixed compilation by disabling debug overlay (#2681) via NachoSoto (@NachoSoto)xrOS
: added support for newpurchase(confirmIn:options:)
method (#2683) via NachoSoto (@NachoSoto)Xcode 15
: handleLocale.currencyCode
deprecation (#2680) via NachoSoto (@NachoSoto)
Other Changes
PurchaseTester
: fixed release compilation (#2689) via NachoSoto (@NachoSoto)xrOS
: fixed runtime warning (#2691) via NachoSoto (@NachoSoto)xrOS
: added support toPurchaseTester
(#2685) via NachoSoto (@NachoSoto)Signature Verification
: newIntegration Tests
(#2642) via NachoSoto (@NachoSoto)ErrorUtils
: handlePurchasesError
to avoid creating unknown errors (#2686) via NachoSoto (@NachoSoto)
4.22.1
Bugfixes
PurchasesOrchestrator
: updateCustomerInfoManager
cache after processing transactions (#2676) via NachoSoto (@NachoSoto)ErrorResponse
: drastically improved error messages, no more "unknown error"s (#2660) via NachoSoto (@NachoSoto)PaywallExtensions
: post purchases withOffering
identifier (#2645) via NachoSoto (@NachoSoto)- Support
product_plan_identifier
for purchased subscriptions fromGoogle Play
(#2654) via Josh Holtz (@joshdholtz)
Performance Improvements
copy(with: VerificationResult)
: optimization to avoid copies (#2639) via NachoSoto (@NachoSoto)
Other Changes
ETagManager
: refactored e-tag creation and tests (#2671) via NachoSoto (@NachoSoto)getPromotionalOffer
: returnErrorCode.ineligibleError
if receipt is not found (#2678) via NachoSoto (@NachoSoto)TimingUtil
: removed slow purchase logs (#2677) via NachoSoto (@NachoSoto)CI
: changedCodecov
toinformational
(#2670) via NachoSoto (@NachoSoto)LoadShedderIntegrationTests
: verify requests are actually handled by load shedder (#2663) via NachoSoto (@NachoSoto)ETagManager.httpResultFromCacheOrBackend
: return response headers (#2666) via NachoSoto (@NachoSoto)Integration Tests
: added tests to verify 304 behavior (#2659) via NachoSoto (@NachoSoto)HTTPClient
: disableURLSession
cache (#2668) via NachoSoto (@NachoSoto)- Documented
HTTPStatusCode.isSuccessfullySynced
(#2661) via NachoSoto (@NachoSoto) NetworkError.signatureVerificationFailed
: added status code to erroruserInfo
(#2657) via NachoSoto (@NachoSoto)HTTPClient
: improved log for failed requests (#2669) via NachoSoto (@NachoSoto)ETagManager
: added new verbose logs (#2656) via NachoSoto (@NachoSoto)Signature Verification
: added test-only log for debugging invalid signatures (#2658) via NachoSoto (@NachoSoto)- Fixed
HTTPResponse.description
(#2664) via NachoSoto (@NachoSoto) - Changed
Logger
to useos_log
(#2608) via NachoSoto (@NachoSoto) MainThreadMonitor
: increased threshold (#2662) via NachoSoto (@NachoSoto)debugRevenueCatOverlay
: displayreceiptURL
(#2652) via NachoSoto (@NachoSoto)PurchaseTester
: added ability to displaydebugRevenueCatOverlay
(#2653) via NachoSoto (@NachoSoto)debugRevenueCatOverlay
: ability to close onmacOS
/Catalyst
(#2649) via NachoSoto (@NachoSoto)debugRevenueCatOverlay
: added support formacOS
(#2648) via NachoSoto (@NachoSoto)LoadShedderIntegrationTests
: enable signature verification (#2655) via NachoSoto (@NachoSoto)ImageSnapshot
: fixed Xcode 15 compilation (#2651) via NachoSoto (@NachoSoto)OfferingsManager
: don't clear offerings cache timestamp when request fails (#2359) via NachoSoto (@NachoSoto)StoreKitObserverModeIntegrationTests
: added test for posting renewals (#2590) via NachoSoto (@NachoSoto)- Always initialize
StoreKit2TransactionListener
even on SK1 mode (#2612) via NachoSoto (@NachoSoto) ErrorUtils.missingReceiptFileError
: added receipt URLuserInfo
context (#2650) via NachoSoto (@NachoSoto)- Added
.xcprivacy
for Xcode 15 (#2619) via NachoSoto (@NachoSoto) Trusted Entitlements
: added debug log withResponseVerificationMode
(#2647) via NachoSoto (@NachoSoto)debugRevenueCatOverlay
: simplified title (#2641) via NachoSoto (@NachoSoto)- Simplified
Purchases.updateAllCachesIfNeeded
(#2626) via NachoSoto (@NachoSoto) HTTPResponseTests
: fixed disabled test (#2643) via NachoSoto (@NachoSoto)- Add
InternalDangerousSettings.forceSignatureFailures
(#2635) via NachoSoto (@NachoSoto) IntegrationTests
: explicitStoreKit 1
mode (#2636) via NachoSoto (@NachoSoto)Signing
: removed API for loading key from a file (#2638) via NachoSoto (@NachoSoto)
4.23.0-beta.1
New Features
Introducing Trusted Entitlements 🛡️ (beta):
Fixes #1900.
This new feature prevents MitM attacks between the SDK and the RevenueCat server.
With verification enabled, the SDK ensures that the response created by the server was not modified by a third-party, and the entitlements received are exactly what was sent.
This is 100% opt-in. EntitlementInfos
have a new VerificationResult
property, which will indicate the validity of the responses when this feature is enabled.
let purchases = Purchases.configure(
with: Configuration
.builder(withAPIKey: "")
.with(entitlementVerificationMode: .informational)
)
let customerInfo = try await purchases.customerInfo()
if customerInfo.entitlements.verification != .verified {
print("Entitlements could not be verified")
}
4.22.0
This release is compatible with Xcode 15 beta 2
New Features
- New
DebugViewController
: UIKit counterpart for SwiftUI'sdebugRevenueCatOverlay
(#2631) via NachoSoto (@NachoSoto) - Created
PaywallExtensions
:StoreView
andSubscriptionStoreView
overloads forOffering
(#2593) via NachoSoto (@NachoSoto) - Introduced
debugRevenueCatOverlay()
: new SwiftUI debug overlay (#2567) via NachoSoto (@NachoSoto)
Bugfixes
- Removed
preventPurchasePopupCallFromTriggeringCacheRefresh
, update caches onwillEnterForeground
(#2623) via NachoSoto (@NachoSoto) - Fixed
Catalyst
build withXcode 15 beta 1
(#2586) via NachoSoto (@NachoSoto)
Dependency Updates
- Bump danger from 9.3.0 to 9.3.1 (#2592) via dependabot[bot] (@dependabot[bot])
Other Changes
StoreTransaction
: added newStorefront
to API testers (#2634) via NachoSoto (@NachoSoto)DebugView
: added snapshot tests (#2630) via NachoSoto (@NachoSoto)verifyNoUnfinishedTransactions
/verifyUnfinishedTransaction
: added missing#file
parameter (#2625) via NachoSoto (@NachoSoto)PostReceiptDataOperation
: clean up cache key (#2628) via NachoSoto (@NachoSoto)PurchasesOrchestrator
: also getStorefront
from SK1 (#2629) via NachoSoto (@NachoSoto)CI
: disable iOS 17 for now (#2627) via NachoSoto (@NachoSoto)Tests
: fixed crash on iOS 13 (#2624) via NachoSoto (@NachoSoto)StoreTransaction
: readStorefront
fromStoreKit.Transaction
(#2611) via NachoSoto (@NachoSoto)StoreKitConfigTestCase
/BaseStoreKitIntegrationTests
: also clear transactions after every test (#2616) via NachoSoto (@NachoSoto)ErrorCode.networkError
: improved description (#2610) via NachoSoto (@NachoSoto)PurchaseTester
: make CI job always point to current version (#2622) via NachoSoto (@NachoSoto)- Improved
finishAllUnfinishedTransactions
(#2615) via NachoSoto (@NachoSoto) StoreKitConfigTestCase
: improvedwaitForStoreKitTestIfNeeded
(#2614) via NachoSoto (@NachoSoto)StoreKitConfigTestCase
: setcontinueAfterFailure
tofalse
(#2617) via NachoSoto (@NachoSoto)PaywallExtensions
: fixed compilation (#2613) via NachoSoto (@NachoSoto)CI
: addediOS 17
job (#2591) via NachoSoto (@NachoSoto)Encodable.jsonEncodedData
: fixed tests on iOS 17 due to inconsistent key ordering (#2607) via NachoSoto (@NachoSoto)debugRevenueCatOverlay
: added ability to display newSubscriptionStoreView
(#2595) via NachoSoto (@NachoSoto)- Refactor: extracted all log strings (#2600) via NachoSoto (@NachoSoto)
- Changed tests to work around
URL
decoding differences iniOS 17
(#2605) via NachoSoto (@NachoSoto) - Removed unnecessary
Strings.trimmedOrError
(#2601) via NachoSoto (@NachoSoto) - Fixed test compilation with
Xcode 15
(#2602) via NachoSoto (@NachoSoto) - Tests: added
iOS 17
snapshots (#2603) via NachoSoto (@NachoSoto) StoreProductDiscount
: addeddescription
(#2604) via NachoSoto (@NachoSoto)debugRevenueCatOverlay
improvements (#2594) via NachoSoto (@NachoSoto)Xcode 15
: fixed all documentation warnings (#2596) via NachoSoto (@NachoSoto)StoreKitObserverModeIntegrationTests
: fixed and disabled SK2testPurchaseInDevicePostsReceipt
(#2589) via NachoSoto (@NachoSoto)StoreKit2TransactionListener
: added log when receivingTransactions.Updates
(#2588) via NachoSoto (@NachoSoto)Dictionary.MergeStrategy
: simplify implementation (#2587) via NachoSoto (@NachoSoto)Configuration.Builder
: fixed doc reference (#2583) via NachoSoto (@NachoSoto)APITesters
: available since iOS 11 (#2581) via NachoSoto (@NachoSoto)
4.21.1
This release is compatible with Xcode 15 beta 1
Bugfixes
Dictionary.MergeStrategy
: fixed Xcode 15 compilation (#2582) via NachoSoto (@NachoSoto)
Other Changes
Custom Entitlements Computation
: added missing scheme to project (#2579) via NachoSoto (@NachoSoto)Custom Entitlements Computation
: added Integration Tests (#2568) via NachoSoto (@NachoSoto)ProductsManager
: improved display of underlying errors (#2575) via NachoSoto (@NachoSoto)StoreKit1Wrapper
: added debug log for duplicatefinishTransaction
calls (#2577) via NachoSoto (@NachoSoto)- Fixed typo in file name (#2578) via NachoSoto (@NachoSoto)
Integration Tests
: avoid crashes when printing receipt (#2570) via NachoSoto (@NachoSoto)Package.swift
fix warning for unrecognizedInfo.plist
(#2573) via NachoSoto (@NachoSoto)
4.21.0
New Features
Offline Entitlements
: use offline-computedCustomerInfo
when server is down (#2368) via NachoSoto (@NachoSoto)
✨ 🌟 With this new feature, even if our main and backup servers are down, the SDK can continue to process purchases. This is enabled transparently to the user, and when the servers come back online, the SDK automatically syncs the information so it can be visible in the dashboard.
Bugfixes
AppleReceipt.debugDescription
: don't pretty-print JSON (#2564) via NachoSoto (@NachoSoto)SK2StoreProduct
: fix crash on iOS 12 (#2565) via NachoSoto (@NachoSoto)GetCustomerInfo
posts receipts if there are pending transactions (#2533) via NachoSoto (@NachoSoto)
Performance Improvements
PurchasedProductsFetcher
: cache current entitlements (#2507) via NachoSoto (@NachoSoto)- Performance: new check to ensure serialization / deserialization is done from background thread (#2496) via NachoSoto (@NachoSoto)
Dependency Updates
- Bump fastlane from 2.212.2 to 2.213.0 (#2544) via dependabot[bot] (@dependabot[bot])
Other Changes
CustomerInfoManager
: post all unfinished transactions (#2563) via NachoSoto (@NachoSoto)PostReceiptOperation
: added ability to also postAdServices
token (#2566) via NachoSoto (@NachoSoto)Offline Entitlements
: improved computation log (#2562) via NachoSoto (@NachoSoto)- Added
TransactionPoster
tests (#2557) via NachoSoto (@NachoSoto) - Refactored
TransactionPoster
: removed 2 dependencies and abstracted parameters (#2542) via NachoSoto (@NachoSoto) CustomerInfoManagerTests
: wait forgetAndCacheCustomerInfo
to finish (#2555) via NachoSoto (@NachoSoto)StoreTransaction
: implementeddescription
(#2556) via NachoSoto (@NachoSoto)Backend.ResponseHandler
is now@Sendable
(#2541) via NachoSoto (@NachoSoto)- Extracted
TransactionPoster
fromPurchasesOrchestrator
(#2540) via NachoSoto (@NachoSoto) enableAdServicesAttributionTokenCollection
: added integration test (#2551) via NachoSoto (@NachoSoto)AttributionPoster
: replaced hardcoded strings with constants (#2548) via NachoSoto (@NachoSoto)DefaultDecodable
: moved toMisc/Codable/DefaultDecodable.swift
(#2528) via NachoSoto (@NachoSoto)CircleCI
: specify device to runbackend_integration_tests
(#2547) via NachoSoto (@NachoSoto)- Created
StoreKit2TransactionFetcher
(#2539) via NachoSoto (@NachoSoto) - Fix load shedder integration tests (#2546) via Josh Holtz (@joshdholtz)
- Fix doc on
Offering.getMetadataValue
(#2545) via Josh Holtz (@joshdholtz) - Extracted and tested
AsyncSequence.extractValues
(#2538) via NachoSoto (@NachoSoto) Offline Entitlements
: don't compute offlineCustomerInfo
when purchasing a consumable products (#2522) via NachoSoto (@NachoSoto)OfflineEntitlementsManager
: disable offlineCustomerInfo
in observer mode (#2520) via NachoSoto (@NachoSoto)BasePurchasesTests
: fixed leak detection (#2534) via NachoSoto (@NachoSoto)PurchaseTesterSwiftUI
: addedProxyView
toiOS
(#2531) via NachoSoto (@NachoSoto)PurchasedProductsFetcher
: removedAppStore.sync
call (#2521) via NachoSoto (@NachoSoto)PurchaseTesterSwiftUI
: added new window on Mac to manage proxy (#2518) via NachoSoto (@NachoSoto)PurchasedProductsFetcher
: added log if fetching purchased products is slow (#2515) via NachoSoto (@NachoSoto)Offline Entitlements
: disable for custom entitlements mode (#2509) via NachoSoto (@NachoSoto)Offline Entitlements
: fixed iOS 12 tests (#2514) via NachoSoto (@NachoSoto)PurchasedProductsFetcher
: don't throw errors if purchased products were found (#2506) via NachoSoto (@NachoSoto)Offline Entitlements
: allow creating offlineCustomerInfo
with emptyProductEntitlementMapping
(#2504) via NachoSoto (@NachoSoto)Offline Entitlements
: integration tests (#2501) via NachoSoto (@NachoSoto)CustomerInfoManager
: don't cache offlineCustomerInfo
(#2378) via NachoSoto (@NachoSoto)DangerousSettings
: debug-onlyforceServerErrors
(#2486) via NachoSoto (@NachoSoto)CocoapodsInstallation
: fixedXcode 14.3.0
issue (#2489) via NachoSoto (@NachoSoto)CarthageInstallation
: removed workaround (#2488) via NachoSoto (@NachoSoto)