mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-10 22:45:55 +05:45
Fixes [CSDK-622]. ### Changes: - Extracted `FileReader` to be able to use it in `ReceiptParser` - Extracted `MockBundle` to be able to use it in `ReceiptParser` - Added new `public` `ReceiptParser.fetchAndParseLocalReceipt()`, **only to `ReceiptParser`** (this is not available through `RevenueCat`). - Added tests for the new API - Added new API to `ReceiptParserAPITester` Initially I thought about moving `ReceiptFetcher` to the `Receipt|Parser` target. Unfortunately that would require moving a whole bunch of other dependencies (`OperationDispatcher`, etc, etc). We have no easy way to create a third "Core" framework in which to place these common dependencies, so that wouldn't be trivial. This solution adds a much simpler version of `ReceiptFetcher` that simply reads from `Bundle.appStoreReceiptURL`. As it's documented there, under normal circumstances `SKReceiptRefreshRequest` is not required, so this implementation should work for 99% of use cases, and so this way we avoid increasing the.codebase complexity unnecessarily. [CSDK-622]: https://revenuecats.atlassian.net/browse/CSDK-622?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ