Commit Graph
1242 Commits
Author SHA1 Message Date
RevenueCat Git BotandToni Rico 3f5e28bfb0 [AUTOMATIC] Release/5.19.0 (#4854)
* Version bump for 5.19.0

* To revert: Deploy UI SDK on commit to continue release process

* Revert "To revert: Deploy UI SDK on commit to continue release process"

This reverts commit 3dca36e0ae.

---------

Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
2025-03-06 15:04:17 +01:00
Antonio Pallares 05fc0a90f3 feat: disable postAttributionData requests when in UI preview mode (#4824)
* 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
2025-03-05 18:04:59 +01:00
Antonio Pallares 81aaf6a051 Offering hasPaywall getter (#4847)
* 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
2025-03-04 12:09:53 +01:00
Antonio Pallares 0ec39f66ae Fix potential wrong count on diagnosis sync (#4846)
* fix: potential count desync in `DiagnosticsSynchronizer`

* tests: add unit tests for invalid entry lines in local diagnostics file
2025-03-04 08:55:05 +01:00
Antonio Pallares f7fa5d2e81 [Diagnostics] Add extra parameters to applePurchaseAttempt (#4835)
* 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
2025-03-03 14:38:00 +01:00
Antonio Pallares de879a0889 Use array instead of sets in diagnostics events (#4839)
* 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
2025-03-02 12:50:03 +01:00
Facundo Menzella fde4e13cd4 chore: Add integration test for analytics events (#4830) 2025-02-28 14:55:32 +01:00
0dc4f55593 Add default refundWindowDuration to HelpPath.init (#4826)
* add default refundWindowDuration to HelpPath.init

* nil by default

* tweaked refund backend decoder

* tweak initialiser

---------

Co-authored-by: Facundo Menzella <facumenzella@gmail.com>
Co-authored-by: Facundo Menzella <facumenzella@users.noreply.github.com>
2025-02-28 09:57:55 +01:00
Toni Rico 8f5a9488e0 [Diagnostics] Add requestedProductIds and notFoundProductIds to appleProductsRequest (#4828) 2025-02-28 09:43:19 +01:00
Facundo Menzella 6b5c430082 chore: Enable force_unwrapping for SwiftLint (#4820)
* enable force_unwrapping

* avoid force unwrap

* fixed all errors

* remove extra disable
2025-02-26 12:40:49 +01:00
Facundo Menzella 75471965de feat: Introduce refund window to control if a refund is offered for a purchase (#4784) 2025-02-25 13:13:49 +01:00
RevenueCat Git BotandToni Rico da921f03d9 Preparing for next version (#4816)
Co-authored-by: Toni Rico <toni.rico.diez@revenuecat.com>
2025-02-24 11:55:48 +01:00
RevenueCat Git Bot ce8ad14741 [AUTOMATIC] Release/5.18.0 (#4815)
* Version bump for 5.18.0

* Update RevenueCat-Swift.h for version 5.18.0
2025-02-22 09:41:07 -06:00
Antonio Pallares b19f66bf28 UI preview mode: disable cache updates (#4809)
* 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
2025-02-21 16:32:20 +01:00
Antonio Pallares e3538def56 UI Preview mode: avoid intro eligibility request (#4800)
* 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
2025-02-21 13:02:23 +01:00
Toni Rico b6c78c60c1 [Diagnostics] Fix store kit error description tracking (#4799) 2025-02-21 12:01:41 +01:00
Antonio Pallares 6c07039715 UI preview mode: disable log in and log out (#4804)
* fail when making log in or log out calls in UI preview mode

* Add unit tests for log in and log out in UI preview mode
2025-02-20 18:27:16 +01:00
Greenie 880c441798 Add prepaid as a period type (#4782) 2025-02-18 21:16:52 +00:00
RevenueCat Git Bot 2ff17def8d Preparing for next version (#4791) 2025-02-18 06:50:37 +01:00
498d7a8329 [AUTOMATIC] Release/5.17.0 (#4783)
* Version bump for 5.17.0

* Update RevenueCat-Swift.h for version 5.17.0

* fix FeedbackSurveyViewModelTests

* Group SwiftUI previews

---------

Co-authored-by: Cesar de la Vega <cesarvegaro@gmail.com>
Co-authored-by: Mark Villacampa <m@markvillacampa.com>
2025-02-17 17:32:16 +01:00
Josh Holtz b4c81d1ff6 [Paywalls V2] Carousel component (#4722)
* This mostly works

* Some cleanup and todos

* Fixed

* BROKEN but need to rebase

* The rework happened

* This is feeling pretty good

* This works

* Fix lint

* Oops

* Or this

* Removed size and implemented top and bottom pager

* Added a todo and compile error

* Made page control optional and added optional size that defaults to fit fit

* Fixes from PR review

* Fix podlint
2025-02-17 09:34:15 +01:00
Antonio Pallares 7683d522fa UI Preview Mode: mock CustomerInfo (#4786)
* feat: mock `CustomerInfo` when in UI Preview mode and avoid caching it

* feat: return mock `CustomerInfo` when in UI Preview mode when requesting the cached `CustomerInfo`

* tests: add unit test for `CustomerInfo` mock in UI Preview mode

* fix linter complaints
2025-02-14 16:34:59 +01:00
Josh Holtz adaaf63a52 [Paywalls V2] Added overflow property to stack (#4767)
* works ish

* Added overflow property to stack

* Rename to default and make it work better
2025-02-14 07:52:51 -06:00
Josh Holtz 09f9646b6e [Paywalls V2] Add visible property to all components (and overrides to ones that were missing) (#4781)
* Visible property

* Added visible property to components

* Removed the EmptyView() from visibles which was necessary

* New VisisbleIfNeeded view

* Removed new VisibleIfNeeded view and made the thing apply functions a ViewBuilder

* Removed extra lint rule
2025-02-14 06:56:56 -06:00
Antonio Pallares 24ada6079b Add Internal support for draft paywall previews (#4761)
* 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
2025-02-13 18:37:04 +01:00
Cesar de la Vega ce5be1b895 Fix for survey answered event not being tracked when not setting a customerCenterActionHandler (#4777)
* fix event not being tracked

* add tests
2025-02-10 17:37:09 +01:00
Facundo Menzella 2b4cc2f233 feat: Introduce ISODurationFormatter (#4776) 2025-02-10 14:44:55 +01:00
RevenueCat Git Bot 0b4b047f6d Preparing for next version (#4765) 2025-02-06 08:10:10 +01:00
RevenueCat Git Bot aeedbe910b [AUTOMATIC] Release/5.16.1 (#4764) 2025-02-05 14:01:22 -06:00
Facundo Menzella e4eb1b4f93 chore: Tweak default copy for dateWhenAppWasPurchased (#4703) 2025-02-05 11:10:04 +01:00
Antonio Borrero Granell e3c08fd956 Rename to Web Billing (#4734) 2025-02-05 09:26:10 +01:00
Will Taylor 3d964a9082 document weak PurchasesDelegate reference 2025-02-04 11:08:41 -06:00
Facundo Menzella aaa77cd1d4 chore: A simple message for posterity (#4758) 2025-02-04 16:59:37 +01:00
Will Taylor 289ef64e73 always call readyForPromotedProduct on main thread/actor 2025-02-03 14:42:29 -06:00
Antonio Pallares 7558e507ee UI preview mode/always fetch offerings (#4754)
* 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
2025-02-03 17:26:45 +01:00
Facundo Menzella fa3ea3264d feat: Add tests for customer center events encoding (#4739) 2025-02-03 12:17:31 +01:00
Antonio Pallares 25d1507411 UI Preview Mode: add extra header to network requests (#4752)
* feat: add new header to network requests when in UI preview mode

* test: add unit tests for header in network requests when in UI Preview mode
2025-01-31 12:33:19 +01:00
Antonio Pallares 12068ccbb5 UI Preview Mode: mock products (#4735)
* 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
2025-01-30 17:26:40 +01:00
RevenueCat Git Bot ca97d66c5c Preparing for next version (#4753) 2025-01-30 16:38:59 +01:00
RevenueCat Git Bot ac44597def Version bump for 5.16.0 (#4751) 2025-01-30 08:54:30 -06:00
AJPallares 788b6276dd UI Preview Mode: app user ID (#4725)
* 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.
2025-01-30 12:14:30 +01:00
Mark Villacampa 4c957eadec [Paywalls] Add background property to Stack component (#4743)
* Add background property to Stack component which will supersede the backgroundColor property

* fix
2025-01-29 21:41:25 -06:00
Josh Holtz 3d86d7dbbb [Paywalls V2] Remove/replace PAYWALL_COMPONENTS compiler flag and fix OS/platform compile issues (#4727)
* 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
2025-01-29 11:53:25 -06:00
AJPallares b94b47e35e Add uiPreviewMode to DangerousSettings (#4714)
* add new opt-in public API `uiPreviewMode` to `DangerousSettings`

* fix: add missing `convenience` to `uiPreviewInitializer` of `DangerousSettings`

* docs: change documentation of `DangerousSettings` init

* test: add API test for new `DangerousSettings` init
2025-01-28 16:48:45 +01:00
Mark Villacampa 6965459b76 [Paywalls] Badge fixes (#4696)
* A few badge-related changes:

- Position the Overlaid badge in the middle if the border instead of its outer edge.
- Position Nested badges inside the border of the stack by default.
- Clip trailing/leading edge-to-edge badges, as well as nested badges, to prevent them form rendering outside the bounds of the stack.
	- This requited us to extract the Shadow from the Shape modifier so they can be applied separatedly. This allows us to apply the badge modifier in the middle, and let it clip the stack before applying the Shadow.

* move shape helpers back to Shape.swift

* Fix support for badge padding

* add back shadow to shape previews

* Fix edge-to-edge top/bottom badges

* fix shadow

* add previews for different stack shapes

properly support top/bottom edge-to-edge badges by extending them behind the stack

* no longer needed to make badge full width

* use rectangle as default shadow shape

* Ensure the border appears over the nested badge in case it needs to clip

* lint
2025-01-28 16:40:34 +01:00
Mark Villacampa c4fb5483a6 [Paywalls] Add Timeline component (#4713)
* Add Timeline component

* rename text -> title

* struct -> class

* lint
2025-01-28 14:51:35 +01:00
Josh Holtz 8584268f15 [Paywalls V2] Fix paywalls badge rendering (#4719)
* Move SwiftUI preview behind DEBUG flag

* Retrun ci

* Fix paywalls badge rendering
2025-01-27 20:39:25 -06:00
Josh Holtz a6736b488d [Paywalls V2] New overrides structure (#4705)
* New overrides in API layer

* Overrides do their thing

* Added tests
2025-01-27 13:12:38 -06:00
RevenueCat Git Bot ed54862d1e Version bump for 5.15.1 (#4709) 2025-01-27 13:26:46 +01:00
Facundo Menzella ab62be609d feat: Add debug section for purchase detail (#4702) 2025-01-27 11:03:14 +01:00