Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracted PurchasesType and PurchasesSwiftType #1912

Merged
merged 3 commits into from
Sep 21, 2022
Merged

Commits on Sep 20, 2022

  1. Purchases.beginRefundRequest: ensured errors are PublicError

    This was missed in #1879. Without this, we might have been forwarding some private errors instead of ensuring that we only sent `CodeError`s
    NachoSoto committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    083fa9b View commit details
    Browse the repository at this point in the history
  2. Extracted PurchasesType and PurchasesSwiftType

    This is needed to fix RevenueCat/purchases-hybrid-common#229
    
    [`purchases-hybrid-common`](https://github.com/RevenueCat/purchases-hybrid-common) had a [hacky implementation of `MockPurchases`](https://github.com/RevenueCat/purchases-hybrid-common/blob/4.2.1/ios/PurchasesHybridCommon/PurchasesHybridCommonTests/Mocks/MockPurchases.swift) that subclassed `Purchases`.
    Because of that, it had 100+ lines of code to initialize the instance, which was never used because all (most) methods were overridden.
    
    This allows a much better way of doing that, **which also enables any SDK user** to mock `Purchases`.
    
    Another benefit of this is that we can see at a glance what the public API is.
    Also, all docstrings are now extracted into the protocol, which makes the implementation file shorter. The docs get inherited by the type itself.
    
    All our API testers pass with no changes, and I've also added the updated `RevenueCat-Swift.h` to verify that no public API changed.
    NachoSoto committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    268da73 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. Remove extra space

    Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
    NachoSoto and tonidero authored Sep 21, 2022
    Configuration menu
    Copy the full SHA
    3b79952 View commit details
    Browse the repository at this point in the history