* feat: disable postAttributionData requests when in UI preview mode
* tests: add unit test to check `AttributionPoster`'s new `clearPostponedAttributionData` method
* tests: add unit tests to check that `AttributionData` is never posted in UI preview mode
* refactor: simplify implementation of avoiding `AttributionPoster` requests in UI preview mode
* feat: add `hasPaywall` getter to `Offering`
Returns `true` if the offering has either a v1 or a v2 paywall
* docs: update some methods references changing `PaywallData` with "paywall", as `PaywallData` only refers to v1 paywalls
* docs: improve reference of `Offering`'s `paywall` and `paywallComponents` to mention the new `hasPaywall` property
* lint
* tests: add unit tests that check the `hasPaywall` property of `Offering`
* api tests: add `paywallComponents` and `hasPaywall` to SwiftAPITester
* feat: add missing properties to `apple_purchase_attempt` diagnostics event
* tests: add + edit unit tests for new diagnostics parameters for SK1 purchase attempt
* fix implementation of sk2 product purchase to catch promotional offer signature error again
* tests: edit unit tests for new diagnostics parameters for SK2 purchase attempt
* fix failing test
* refactor: separate error handling in purchase SK2 product method into its own method
* address PR #4835 comments
* lint
* tests: remove `Equatable` conformance of `DiagnosticsEvent` and `AnyEncodable` from RevenueCat and added to test targets (where it's needed)
* Use Arrays instead of Sets in Diagnostics events to have predictable order in sent events
* tests: compare Sets vs Arrays in unit test
The conversion from Array --> Set --> Array may change the order of the elements
* remove `DiagnosticsEvent+Equatable` from some targets
* PR #4839 fixes
* remove `AnyEncodable+Equatable.swift` from some targets
* Prevent calling the GET request to the intro eligibility endpoint when in UI Preview mode
* fix lint warning
* tests: add unit tests for `TrialOrIntroPriceEligibilityChecker` in UI preview mode
* fake `unknown` intro eligibility status for products in UI preview mode
* tests: remove empty check on intro eligibility result dictionary when in UI preview mode
* add comment to early return for check eligibility in UI preview mode
* do not update cache when in UI preview mode
* tests: add unit tests to check that first initialization never calls get offerings when in UI preview mode
* tests: add unit test to cover call to `updateAllCachesIfNeeded(isAppBackgrounded: Bool)` in UI preview mode
* Prevent calling the GET request to the intro eligibility endpoint when in UI Preview mode
* fix lint warning
* tests: add unit tests for `TrialOrIntroPriceEligibilityChecker` in UI preview mode
* fake `unknown` intro eligibility status for products in UI preview mode
* tests: remove empty check on intro eligibility result dictionary when in UI preview mode
* add comment to early return for check eligibility in UI preview mode
* feat: add support for presenting draft paywalls under `@_spi(Internal)` attribute
* fix: initialize `useDraftPaywall` property of `PaywallView`
* feat: have `PaywallView` actually show draft paywall when `useDraftPaywall` is `true`
* remove lint warning
* silence linter warning
* tests: add unit tests for `paywallComponents` and `draftPaywallComponents` in `OfferingsResponse`
* tests: move test offerings with v2 paywalls into a new file not to affect existing decode + encode test
* remove unnecessary property wrapper
* silence lint warning
* feat: force fetch Offerings from network when in UI Preview mode
* test: add unit test for force fetching Offerings from network when in UI Preview mode
* feat: mock fetched `StoreProducts` when in UI Preview mode
* feat: improve mocking of products in UI Preview mode to have consistent paywall previews
* fix: mock of products where packages are not unique
* test: add unit tests for OfferingsManager in UI preview mode
* address PR #4735 comments
* feat: use fix, hardcoded `appUserID` for UI preview mode
* test: add unit tests for user ID in UI preview mode
* fix linter's Trailing Whitespace Violations
* PR #4725 comments
* Change default appUserID for UI Preview mode.
* Add debug log regarding the use of UI Preview mode user ID.
* We can't just remove PAYWALL_COMPONENT because we don't support macos and tv and things were failing
* Move PartialComponent outside of PaywallComponent extension
* Fix some lint errors
* Wrong thing
* Undid things i shouldn't have done
* Removed more
* Added comment
* Removed/fix some places for the check thingies
* RevenueCat module compiles on all the things
* RevenueCatUI compiles in all the platforms now
* Make all the things compile again
* Make work for visionOS
* Fix some platform and xcode version issues
* Fix failing spm ios 15 test
* Undo circleci changes
* Replace smooth with easeInOut
* Only run the thing i want
* Attempt to remove circular
* Explicit returns
* Does this pass
* This is it
* Swift 5.9 for this
* All tests again
* Undid public testing processor stuff
* Undo this too
* Swift compiler check out pill style circular
* Fixes from PR review
* Fix compile for mac
* This mostly works
* This mostly works
* Better tests and logic
* More tests
* Fixed onemore
* lint
* Fix tests
* Actually use this
* Fix for all quantity translation things
* More minor fixes
* Fix tests
* Added tests
* Removed compiler flags because extra work to handle this on CI unit tests when we are releasing this soon and this isn't really that dangerous
* Fix lint
* Some naming improvements
* Passing UIConfig into Offering
* Reorged some data structures
* Fixed some lint
* This
* support non-JSON decodable values in getMetadataValue
* remove method definition claiming to throw
* Update Offering.swift
* test for primitive decodable metadata values without a default
* simplify decoding
* Send paywall events when the app is backgrounded.
* - Add tests for syncing paywall events when backgrounding
- Send events after a successful purchase + tests
* typo
* typo
* Introduce PurchaseParams to allow passing extra configuration info when making a purchase
* simplify naming
* fallback to old method when flag is not enabled
* Add $(inherited) to the test targets so they pick up compiler flags from Local.xcconfig
* Include product/package inside PurchaseParams
* fix tests
* add compiler flag check
* update purchase tester
* fix docs
* add tests
* Update Sources/Networking/Operations/PostReceiptDataOperation.swift
Co-authored-by: Toni Rico <toni.rico.diez@revenuecat.com>
---------
Co-authored-by: Toni Rico <toni.rico.diez@revenuecat.com>
When compiling with Xcode 16, we started throwing a bunch of new warnings. Here's a list and explanation of each:
- The most common one was needing to explicitly restate the @unchecked Sendable conformance from a parent class.
- There were a couple switches where a new entry was added in tvOS but only for iOS 18, and needed to add it to make it exhaustive.
- There we a couple of places where we were adding a protocol conformance to a class from a different module e.g. extension DispatchTimeInterval: Comparable. This is considered unsafe now because the owners of the module could add the conformance later. Solved by removing the conformance which wasn't being used widely in the codebase, only in tests.
- Finally there was a class where we were capturing SKRequest and SKProductsRequest instances in a sendable block, but only to either log something, or use them as dictionary key, so I just made the classes Sendable (with the new @retroactice attribute because they belong to a different module)