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
* [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>
* 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
* 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