Commit Graph
20 Commits
Author SHA1 Message Date
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
Will Taylor f638ae7952 support redeeming win-back offers with streamlined purchasing disabled 2024-11-08 10:43:59 -06:00
Will Taylor 6de169a23e support fetching eligible win-back offers for a product 2024-11-06 15:46:04 -06:00
NachoSoto 2bcd0ce328 5.0.0 changes: support SK2 by default 2024-07-01 14:37:21 -05:00
32c63cdb46 [SK2] Add support for StoreKit Config files in SK2 (#3365)
When using StoreKit Config file, we do not have access to the
transaction history or subscription status server-side.

To work around this, we introduce a new `StoreKit2Receipt` type that
closely resembles the structure of an SK1 receipt and contains all the
transaction history and subscription status for the customer. It can be
sent in a single request to `/receipt`

---------

Co-authored-by: RevenueCat Git Bot <72824662+RCGitBot@users.noreply.github.com>
Co-authored-by: Distiller <distiller@static.38.39.183.137.cyberlynk.net>
Co-authored-by: Distiller <distiller@static.38.23.40.89.cyberlynk.net>
Co-authored-by: Distiller <distiller@static.38.39.185.65.cyberlynk.net>
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
2023-12-13 17:00:37 +01:00
Toni RicoandNachoSoto 773fd84a65 StoreKit In App messages support (#3252)
### Description
StoreKit displays different types of in-app messages on app launch, but
it provides an API to disable that and show these messages at a
different time. This PR wraps those APIs to make them easier to use
through our SDK.

#### New APIs
- Add new configuration parameter to defer StoreKit's automatic in-app
messages
- Add new method in `Purchases` to display a list of specific message
types
- New `StoreKitMessageType` enum mapping to the types used by StoreKit

---------

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
2023-10-03 16:58:53 +02:00
NachoSoto 7f875ae212 Changed Logger to use os_log (#2608) 2023-06-15 15:13:48 -07:00
NachoSoto 6c3b4d493c Always initialize StoreKit2TransactionListener even on SK1 mode (#2612) 2023-06-14 12:47:18 -07:00
NachoSoto 3388bc5437 Refactor: extracted all log strings (#2600)
I'm working on improving our logging setup, which will be made easier if
we don't use hardcoded strings in our logs.
2023-06-09 09:48:26 -07:00
NachoSoto cc0ee6a1e1 ProductsManager: improved display of underlying errors (#2575)
This goes from:
```
ERROR: 🍎‼️ Store products request failed! Error: UNKNOWN_ERROR
```
To:
```
ERROR: 🍎‼️ Store products request failed! Error: Error Domain=SKErrorDomain Code=0 "UNKNOWN_ERROR" UserInfo={NSLocalizedDescription=UNKNOWN_ERROR, NSUnderlyingError=0x600002b04cf0 {Error Domain=ASDErrorDomain Code=950 "Unhandled exception" UserInfo={NSLocalizedDescription=Unhandled exception, NSLocalizedFailureReason=An unknown error occurred}}}
```
2023-06-02 09:47:34 -07:00
NachoSoto 6bc1445e06 StoreKit1Wrapper: added debug log for duplicate finishTransaction calls (#2577) 2023-06-02 08:32:45 -07:00
Nick Kohrn ebf29df99e Fix typo in log (#2315)
Here's a simple logging typo fix.
2023-02-27 14:42:14 -08:00
NachoSoto 30c7e9e168 StoreKit1Wrapper: added warning if receiving too many updated transactions (#2117)
See #2107. We still don't know what caused that, but it leads to
degraded performance (mildly reduced by #2115). To advice of that, in
case users are wondering why the app might potentially take excessive
CPU usage, I added this warning.
2022-12-20 14:08:53 -08:00
NachoSoto b8f300d2c8 StoreKitRequestFetcher: added log when starting/ending requests (#2151)
This would have given more visibility into the need for #2146.
2022-12-15 08:51:00 -08:00
NachoSoto b91a0ecf2f StoreKit: added logs when purchasing and product requests are too slow (#2061)
Using #2059 in a few places for now.
We can add this to more places, and tweak the thresholds.

Fixes [CSDK-512].

[CSDK-512]:
https://revenuecats.atlassian.net/browse/CSDK-512?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-11-25 17:00:54 -08:00
NachoSoto 32c28e16b9 Disable SK1's StoreKitWrapper if SK2 is enabled and available (#1882)
When SK2 is enabled, `StoreKit2TransactionListener` is enough to handle transactions, so it's no longer necessary to have that and `StoreKitWrapper` both listening to them.
2022-09-05 17:32:12 -07:00
343ba7eaf4 AdServices (#1727)
* [CF-106] Fetch AdServices Token (#1519)

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
Co-authored-by: Josh Holtz <me@joshholtz.com>

* [CF-553] Post AdServices token (#1534)

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
Co-authored-by: Josh Holtz <me@joshholtz.com>

* Update ios 14 snapshots tets

* Reworked adservices to use new Purchases.shared.attribution API

* Updated with some comments from PR

* Add iAd code back (#1739)

Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>

* use new mapKeys dictionary extension for device cache

* update for some pr comments

* remove purchasestests

* generate missing snapshots

* fix deprecation messages to clarify method now called on shared instance

* Fix for inserting nonstring into userdefaults

* Add tests for bug

* fix lint

* Added availablility checks for tests and removed unused varialbes

* Whoops... wrong class

Co-authored-by: beylmk <maddie@revenuecat.com>
Co-authored-by: NachoSoto <NachoSoto@users.noreply.github.com>
2022-08-08 07:42:42 -05:00
beylmk 33840f605f Add missing logs to ProductsFetcherSK2 (#1780) 2022-08-01 17:15:24 -05:00
NachoSoto 1857932e0e SK1StoreProductDiscount: handle SKProductDiscount.priceLocale being nil and created StoreKitWorkarounds (#1545)
Fixes #1521.
Despite `SKProductDiscount.priceLocale` being non-optional, StoreKit might return `nil` `NSLocale`s.
This works around that to make sure the SDK doesn't crash when bridging to `Locale`.
2022-05-12 08:55:02 -07:00
aboedo f5697de730 renamed Purchases folder to Sources (#1416)
* renamed `Purchases` folder to `Sources`

* temporarily enabling installation test jobs

* re-disabling installation test jobs
2022-03-28 11:53:24 -03:00