This repository contains production-ready code examples for implementing efficient paywall data loading with Adapty's iOS SDK. For more information on the examples provided in this repo, please refer to the Paywall Loading Guide found here.
Network quality monitoring implementation using Apple's Network framework. Provides dynamic fetch policy recommendations based on connection quality (excellent, good, poor, unavailable) and integrates with Adapty's caching strategies to optimize loading performance across varying network conditions.
Production-ready service layer that wraps Adapty SDK calls with network-aware fetch policy selection. Demonstrates how to balance data freshness with loading speed by automatically choosing between .reloadRevalidatingCacheData
and .returnCacheDataElseLoad
based on runtime network conditions.
Observable repository pattern implementation that manages paywall caching and provides type-safe access to products, remote configurations, and Paywall Builder configurations. Includes automatic background refresh for cached items and supports critical placement preloading during app initialization.
A Swift model demonstrating the RemoteConfigurable
protocol pattern for type-safe JSON configuration parsing. Includes fallback mechanisms for handling malformed or missing remote config data, ensuring robust paywall presentation even when configuration fails.
These examples use modern Swift Concurrency patterns (async/await
) and SwiftUI, assuming familiarity with common iOS architecture concepts like MVVM and repository patterns. They're designed to integrate with existing app architectures while providing the foundations for reliable, performant paywall experiences at scale.
MIT License - see LICENSE file for details.