Skip to content

adaptyteam/paywall-loading-guide-iOS

Repository files navigation

Paywall Loading Guide for iOS

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.

Code Examples

NetworkMonitor

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.

AdaptyPaywallService

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.

PaywallRepository

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.

OnboardingRemoteConfig

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.

Integration

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.

License

MIT License - see LICENSE file for details.

About

Code examples for the iOS Paywall Loading Guide found in Adapty's documentation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages