Commit Graph
7 Commits
Author SHA1 Message Date
Mark VillacampaandToni Rico 72b06f6943 Introduce PurchaseParams to allow passing extra configuration info when making a purchase (#4400)
* 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>
2024-11-06 16:05:37 +07:00
NachoSoto d9c49690f9 PurchaseTesterSwiftUI improvements (#2345) 2023-03-21 06:35:48 -07:00
NachoSoto 3aaf9de70c PurchaseTester: fixed leak when reconfiguring Purchases (#2311) 2023-02-22 06:55:05 -08:00
NachoSoto f9793d72d3 Purchase Tester: added ability to purchase products directly with StoreKit (#2172)
This will help test observer mode, mimicking how an app might use
`RevenueCat` with observer mode.

When that setting is enabled, 2 new buttons will appear:
![Simulator Screen Shot - iPhone 14 Pro Max - 2022-12-20 at 08 58
07](https://user-images.githubusercontent.com/685609/208723050-56644a9a-d78f-4788-bda1-b64bdc400b40.png)

The implementation isn't the most maintainable, but we don't really need
it to be. I favored simplicity instead of over-complicating the
implementation. It's not meant to be a canonical example of the correct
way to purchase with StoreKit, just a quick way of testing this
behavior.
2022-12-21 08:29:47 -08:00
NachoSoto 432b704dc7 Purchase Tester: added companion watchOS app (#2140)
I added this in order to debug #2132.

### Changes:
- Extracted `Core` framework to be used by both apps
- Added new `watchOS` target
- Changed `fastlane match` to also create profiles for this new target
- Added a simple view in the watch app that displays a text if an
entitlement is active, or a `restore` purchases button otherwise

This is just a starting point, we can add more to it in the future.

#### Note:
_Unfortunately I haven't been able to test this because of an Apple bug
(`FB11873951`):_


![incoming-722CC7FA-D970-4E23-AB88-50167248D98D](https://user-images.githubusercontent.com/685609/207672762-23abe3e7-6052-4b16-bdf2-7b1e502ffd81.PNG)
2022-12-21 07:31:58 -08:00
NachoSoto 2773783274 PurchaseTesterSwiftUI: allow configuring API key at runtime (#1999)
Fixes [CSDK-456].

### Configuration screen:
![Simulator Screen Shot - iPhone 13 Pro Max - 2022-10-25 at 15 02
26](https://user-images.githubusercontent.com/685609/197890837-3160d9cd-72e0-45d7-8e9e-f248b0dd93c5.png)

### Displaying errors:
_Note that if you enter an invalid API key and there's a credentials
issue, you can tap on "reconfigure" to start over:

![Simulator Screen Shot - iPhone 13 Pro - 2022-10-26 at 13 35
42](https://user-images.githubusercontent.com/685609/198134117-d80f7c28-922b-4c48-be83-9b8ec03de299.png)

[CSDK-456]:
https://revenuecats.atlassian.net/browse/CSDK-456?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-11-03 14:44:42 -07:00
Josh Holtz 971b596727 New SwiftUI Purchase Tester example (#1722)
* Initial commit of new SwiftUI Purchase Tester

* Mover to Test/TestingApps/PurchaseTesterSwiftUI and updated deprecated attribution stuff

* Undoing things here because whoops

* Updates from PR
2022-06-24 09:33:13 -05:00