Commit Graph
3 Commits
Author SHA1 Message Date
NachoSoto 56741f0a92 Paywalls: improve error display (#3577)
### Before:

This prevents "leaking" _RevenueCat_ in the error dialogs:

![Simulator Screenshot - iPhone 15 Pro Max - 2024-01-16 at 12 45
13](https://github.com/RevenueCat/purchases-ios/assets/685609/a59bce50-a470-44fb-9d36-1553abcc8488)

### After:
With this change, users still get some information about the problem,
and we get enough context to be able to diagnose it:

![Simulator Screenshot - iPhone 15 Pro Max - 2024-01-16 at 12 57
15](https://github.com/RevenueCat/purchases-ios/assets/685609/721d0197-5507-4618-9fe1-e0e748b0bc32)
2024-01-16 16:27:32 -08:00
NachoSoto 2103b04762 Paywalls: added MIT license to all headers (#3084)
`Xcode` doesn't allow customizing the header (looks like maybe it worked
at some point but not anymore:
https://stackoverflow.com/questions/67614785/changing-the-default-header-comment-license-in-swift-package).

At least this adds the license to all the initial files in the package.
2023-09-14 18:28:11 -07:00
NachoSoto b2897768f1 Paywalls: handle missing paywalls gracefully (#2855)
- Improved `PaywallView` API: now there's only 2 constructors (with
optional `Mode` parameters):
    - `PaywallView()`
    - `PaywallView(offering:)`
- New `PaywallData.default` as a fallback when trying to present a
paywall with missing data (either because it failed to decode, or it's
missing)
- Extracted error state handling to `ErrorDisplay` (used by
`PaywallView` and `AsyncButton` now). It can optionally dismiss the
presenting sheet.
- Handling offering loading errors in `PaywallView`
- Improved `DebugErrorView` to allow displaying a fallback view:
```swift
DebugErrorView(
    "Offering '\(offering.identifier)' has no configured paywall.\n" +
    "The displayed paywall contains default configuration.\n" +
    "This error will be hidden in production.",
    releaseBehavior: .replacement(
        AnyView(
            LoadedOfferingPaywallView(
                offering: offering,
                paywall: .default,
                mode: mode,
                introEligibility: checker,
                purchaseHandler: purchaseHandler
            )
        )
    )
)
```
- Added `LoadingPaywallView` as a placeholder view during loading
- Improved `MultiPackageTemplate` and `RemoteImage` to fix some layout
issues during transitions
- Added transition animations between loading state and loaded paywall
2023-09-14 18:28:11 -07:00