Commit Graph
16 Commits
Author SHA1 Message Date
NachoSoto b3875a9380 Exposed PurchasesReceiptParser and AppleReceipt (#2153)
Initial step for [CSDK-17]. Fixes [CSDK-523].

### Changes:
- Renamed `ReceiptParser` to `PurchasesReceiptParser` to avoid name
collision with future SPM `ReceiptParser`
- Exposed `ReceiptParser`, `AppleReceipt`,
`PurchasesReceiptParser.Error`
- Added new types to `SwiftAPITester`
- Added docs to these types
- Moved `LoggerType` to be available to `ReceiptParser`
- Moved `DateFormatter+Extensions` to be available to `ReceiptParser`
- Moved `Codable+Extensions` to be available to `ReceiptParser`
- Created `ReceiptParserLogger` for `ReceiptParser`


[CSDK-17]:
https://revenuecats.atlassian.net/browse/CSDK-17?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

[CSDK-523]:
https://revenuecats.atlassian.net/browse/CSDK-523?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-12-22 10:09:12 -08:00
NachoSoto 3ce5c48f0c Documentation: Fixed references in V4_API_Migration_guide.md (#2018)
Equivalent to #2002.
2022-11-07 12:39:34 -08:00
NachoSoto faf51e3d99 Introduced PurchasesDiagnostics to help diagnose SDK configuration errors (#1977)
Finishes [CSDK-451].

This new small public API allows users to quickly figure out if
everything in the SDK is correctly configured in a simple way:
```swift
let diagnostics = PurchasesDiagnostics.default
do {
    try await diagnostics.testSDKHealth()
} catch {
    print(error)
}
```

The specific underlying errors will provide information about what
failed.

We can continue growing this to check for more specific things, but for
now it does 4 things:
- Verify API connectivity: networking issues, firewalling, etc.
- Verify API key is correct
- Verify `Offerings` are configured correctly
- Verify that all products in `Offerings` are configured correctly and
found in `StoreKit`

This new API is covered by:
- API testers
- Unit tests
- Integration tests (both on `SK1` and `SK2`)

_I've taken the "shortcut" of making this `async` only (while still
compatible with Objective-C), which means it's not compatible with iOS
12.x. But that made the implementation a lot simpler, which I think is a
useful tradeoff._

### Depends on:
- #1970
- #1971
- #1973
- #1974
- #1975
- #1976

[CSDK-451]:
https://revenuecats.atlassian.net/browse/CSDK-451?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-10-27 12:00:53 -07:00
NachoSoto 74233408c4 Docs: fixed logIn references (#2002) 2022-10-26 14:43:43 -07:00
Josh Holtz 5a2c37d892 Update migration doc from didReceiveUpdatedCustomerInfo to receivedUpdatedCustomerInfo (#1836) 2022-08-16 08:24:02 -05: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
NachoSoto a4bf2647f8 Purchases.configure: added overload taking a Configuration.Builder (#1720)
Fixes [CF-780].

See https://github.com/RevenueCat/purchases-ios/issues/1717#issuecomment-1160718519 for an example of a user trying to do this.
2022-06-21 12:34:11 -07:00
Joshua Liebowitz 29f96df1e5 Extract Attribution logic out of Purchases (#1693)
* Update attribution namespacing in tests and tester
* Add deprecations
2022-06-14 14:37:58 -07:00
Joshua Liebowitz 2d0a9e8820 Update doc reference to `Purchases/customerInfo(fetchPolicy:)` (#1636)
* Update doc reference to ``Purchases/customerInfo(fetchPolicy:)``
* Replace ``Purchases/customerInfo()`` with ``Purchases/customerInfo(fetchPolicy:)``
2022-05-31 15:26:17 -07:00
aboedo 85bff6d467 cleaned up docs for the configure method (#1623) 2022-05-27 10:24:38 -03:00
aboedo 3fa269a2b4 alphabetized integration subs attributes in documentation and added setCleverTapID (#1530) 2022-04-25 15:04:24 -03:00
aboedo 5679b2b954 expose setPushTokenString method (#1525)
* added setPushTokenString methods

* added links to the new method in docC

* fixed swift api tests

* actually fixed them now, don't know what I was thinking on the previous commit

* fix tests
2022-04-25 14:20:50 -03:00
Cody Kerns 7ee038f20f New public convenience setter for Firebase app instance ID (#1522)
* Adds Firebase convenience setter
2022-04-21 14:20:52 -04:00
NachoSoto 8f9fd110b5 Renamed PurchasesDelegate.purchases(_:shouldPurchasePromoProduct:defermentBlock:) (#1460)
Finishing #1439.
Fixes [CF-464].

The goal of this change is to make the behavior and usage of this API more clear.

[CF-464]: https://revenuecats.atlassian.net/browse/CF-464?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2022-04-11 12:55:55 -07:00
Cody Kerns 441058fae7 Add SK2 initializer to DocC (#1468) 2022-04-06 16:17:38 -04:00
aboedo e5710aeaee Static docC docs part 2: folder structure cleanup for docC plugin (#1421)
* added lanes to preview and compile docc docs

* added package dependency on swift-docc-plugin

* ignored all Package.resolved files

* added env variable so that the package doesn't unnecessarily pull in the docC plugin for our customers

* fix linting

* moved docC catalog for spm plugin compatibility, added empty swift file, updated Package.swift so it only builds from sources

* fixed a couple of outdated paths

* added comment to empty file
2022-03-31 12:20:39 -03:00