Commit Graph
21 Commits
Author SHA1 Message Date
Pol Piella Abadia f14673852e Fix Backwards compatibility errors introduced by new testSDKHealthCheck implementation (#5022)
* Forks into a separate method to be preserver backwards compatibility

* Resets `PurchasesDiagnosticsHealth` to state before merge

* Adds missing unit tests

* Fixes lint errors

* Fixes errors

* Updates documentation

* Moves types under the debug flag

* Moves more types under debug

* Adds reference to error in documentations
2025-04-28 17:26:06 +00:00
47f40f5abe [DX-345] Update the testSDKHealth to use the new /health_report endpoint (#4979)
* Initial app creation

* Initial screen

* Installs and configures the SDK

* Creates a full Swift 6 compliant ViewModel

* Adds a demo customer center button

* Fixes icon name

* Updates a bit of the logic to fetch offerings

* Updates initial layout by showing offerings

* Makes more progress with a VERY DRAFT and VERY WIP screen

* Creates a new network path and requests

* Creates a new health API and adds it to the BE class

* Creates a `checkOfferings` method

* Pushes local changes

* Moved viewmodels to separate files

* Prepared some basic UI structure

* Initial shell of the new method for testing

* Initial implementation of `HealthReportOperation` from the SDK

* Passes `appUserId` through to the internal API

* Adds a new path called `appUserID`

* Removes 'old' `appHealth` endpoint

* Creates a new model for the network response

* Report should be the response type

* Updates backend request

* Updates types and documentation for the new internal request

* Moves validation into its own file

* Replaces method for DebugViewModel

* Updates error messages

* Updates the `Status` section

* Adds logic to show failure reason

* Removes Sample App from PR

* Resets `Package.resolved`

* Availability checks

* Check if device is authorized to make payments

* Fixes all SwiftLint errors

* Updates `ProductStatus` to not have a raw value of String

* Minor style fixes

* Removes warning

* Adds more availability checks

* Fixes comments

Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>

* Simplifies logic

* Updates comment

* Updates the comments to denote that this method is not intended for production use

* Removes android-only invalid SDK version error

* Adds an action button that the user can use to open the dashboard

* Updates copy about non-actionable item

* Prefers `Your RevenueCat Configuration` to `The Dashboard`

* Removes `Sendable`-related warnings

* Fixes unit tests on CI/CD

* Fixes tests

* Adds unit test for offering configuration error

* Adds unit test for no packages in default offering

* Adds unit test for generic offering configuration

* Removes periods from the end of the error messages

* Adds unit tests for all new errors

* Fixes linter errors

* Wrap in a `DEBUG` compiler directive

* Includes all products in the healthy check status to be used in the Sample App

* Updates report to include product and offering information

* Moves logic over to the report rather than being exclusive to the Debug View

* Fixes CI/CD failures

* Updates the asset for the health check status

---------

Co-authored-by: Hidde van der Ploeg <hiddevanderploeg@me.com>
Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
2025-04-24 13:46:21 +00:00
NachoSoto 53fe9cd7bd Xcode 15.3 beta 1: fix compilation errors (#3599)
### Changes:
- `InternalAPI` is now `Sendable` to deal with new compilation error
- `PaywallEventStoreType` is now `Sendable`
- Extracted `SK2BeginRefundRequestHelperType` to make
`SK2BeginRefundRequestHelper` `Sendable`
- Updated `MockSK2BeginRefundRequestHelper` to be thread-safe and
`Sendable`
- Fixed compilation error in `DebugContentViews`
- Fixed compilation error in `DebugViewModel`
- Fixed compilation error in `StoreMessagesHelper`
2024-01-25 15:29:31 -08:00
NachoSoto 67b421e2b1 .debugRevenueCatOverlay: added Locale (#3539)
This adds the `Locale.identifier` and the currency code.
It can help debug issues with paywalls, currencies, localization, etc.

![Simulator Screenshot - iPhone 15 Pro Max - 2023-12-21 at 11 05
36](https://github.com/RevenueCat/purchases-ios/assets/685609/c0b5db10-8ab8-4119-9992-522065979612)
2023-12-21 12:19:54 -08:00
NachoSoto 4bca13f90d Debug View: display receipt status (#3303) 2023-10-16 07:34:34 -07:00
NachoSoto efb8239133 debugRevenueCatOverlay: added list of active entitlements (#3247)
![Screenshot 2023-09-22 at 14 51
15](https://github.com/RevenueCat/purchases-ios/assets/685609/1d799147-16b6-4add-ada0-d4fbe9b2bd78)
2023-10-02 09:30:13 -07:00
NachoSoto 43030b16f3 Debug: add Offering metadata to debug screen (#3137) 2023-09-14 18:28:11 -07:00
NachoSoto 483e03c1fa Paywalls: added JSON debug screen to debugRevenueCatOverlay (#2972) 2023-09-14 18:28:11 -07:00
NachoSoto dab5035a19 visionOS: support for Xcode 15 beta 6 (#2989)
### Context:

`#if os(iOS)` no longer evaluates to `true` when compiling for
`visionOS`
Which means we need `|| os(xrOS)`.
But to support older Xcode we need `#if swift(>=5.9) && os(xrOS)`.
But, fun fact, short-circuiting doesn’t work in `Xcode 13`.
And we still need that to run iOS <15 tests (`FB12223404` /
`FB12805891`)

💩 

This works around that by defining our own `VISION_OS` flag.

### Changes:
- Added `VISION_OS` compile time flag to determine SDK
- Replaced `#if os(xrOS)` with `#if VISION_OS`
- Added flag to `Package.swift` (thanks @neonichu for helping with this)
2023-08-09 11:19:40 -07:00
NachoSoto c7db551bc4 xrOS: add support for debugRevenueCatOverlay (#2702) 2023-06-26 13:06:13 -07:00
NachoSoto 76c440b204 xrOS: fixed compilation by disabling debug overlay (#2681)
We can look into making them work in the future, but for now this helps
compile the SDK for `xrOS`.
2023-06-22 08:42:04 -07:00
NachoSoto 44608c33bb PaywallExtensions: post purchases with Offering identifier (#2645)
### Changes:

- Exposed `internal`-only `Purchases.cachePresentedOfferingIdentifier`
- Changed `SwiftUI` extensions to `static` methods: this is required to
be able to call an instance method on them
- Added integration test to verify this offering identifier is used

Technically this is an API change, but these APIs are implicitly beta
because they're only available in Xcode 15 beta.
2023-06-15 17:16:31 -07:00
NachoSoto 6ba378ba5e debugRevenueCatOverlay: display receiptURL (#2652)
Useful when debugging issues like #2558.

![Screenshot 2023-06-14 at 11 58
28](https://github.com/RevenueCat/purchases-ios/assets/685609/3fcb55bc-107e-46fd-aced-0d12d0667cba)
2023-06-15 08:37:58 -07:00
NachoSoto 1637db2180 debugRevenueCatOverlay: ability to close on macOS/Catalyst (#2649)
![Screenshot 2023-06-14 at 11 53
37](https://github.com/RevenueCat/purchases-ios/assets/685609/206242bc-4887-495b-a894-2bda064bd8a3)
2023-06-15 08:10:35 -07:00
NachoSoto 7958e91dff debugRevenueCatOverlay: added support for macOS (#2648)
I wanted to support it to be able to look into #2558.


![image](https://github.com/RevenueCat/purchases-ios/assets/685609/cdba0488-965e-4887-bef0-ae151430889a)
2023-06-15 08:10:03 -07:00
NachoSoto 0d448c1265 debugRevenueCatOverlay: simplified title (#2641) 2023-06-14 07:46:58 -07:00
NachoSoto 5ec9d36e22 New DebugViewController: UIKit counterpart for SwiftUI's debugRevenueCatOverlay (#2631)
Built on top of `DebugSwiftUIRootView`. This can be presented either
manually, or using `UIViewController.presentDebugRevenueCatOverlay`.

This looks exactly the same as the `SwiftUI` version:

![image](https://github.com/RevenueCat/purchases-ios/assets/685609/2ef22db4-0030-457e-a721-8daf2dcc1a49)
2023-06-13 09:37:52 -07:00
NachoSoto 551cb2d8d2 DebugView: added snapshot tests (#2630)
UI tests for #2567.
2023-06-13 08:54:36 -07:00
NachoSoto 51865954cb debugRevenueCatOverlay: added ability to display new SubscriptionStoreView (#2595)
See #2593

![Simulator Screenshot - iPhone 14 Pro Max - 2023-06-07 at 13 07
58](https://github.com/RevenueCat/purchases-ios/assets/685609/551dd3e0-80f8-4b68-b79f-abcf078fb56f)
2023-06-09 10:55:31 -07:00
NachoSoto ce470442cf debugRevenueCatOverlay improvements (#2594) 2023-06-08 08:37:22 -07:00
NachoSoto 3b53f2426c Introduced debugRevenueCatOverlay(): new SwiftUI debug overlay (#2567)
![simulator_screenshot_DBF551B9-3BA8-440D-9B3F-16DB1D47A0A7](https://github.com/RevenueCat/purchases-ios/assets/685609/af1ddee9-6ae7-4766-9b12-4875416477c6)
2023-06-07 09:16:45 -07:00