Add RevenueCat support to a Swift application through the SwiftfulPurchasing framework.
Details (Click to expand)
Add SwiftfulPurchasingRevenueCat to your project.
https://github.com/SwiftfulThinking/SwiftfulPurchasingRevenueCat.git
Import the package.
import SwiftfulPurchasingRevenueCatConfigure PurchaseManager with RevenueCatPurchaseService:
#if DEBUG
let purchaseManager = PurchaseManager(service: MockPurchaseService(), logger: logManager)
#else
let purchaseManager = PurchaseManager(service: RevenueCatPurchaseService(apiKey: revenueCatApiKey), logger: logManager)
#endifYou can call logIn every app launch.
let products = try await purchaseManager.getProducts(productIds: ["product.yearly"])
try await purchaseManager.purchaseProduct(productId: "product.yearly")
try await purchaseManager.restorePurchase()
try await purchaseManager.logIn(userId: "user_123", userAttributes: PurchaseProfileAttributes(email: "hello@example.com"))
try await purchaseManager.logOut()
try await purchaseManager.checkTrialEligibility(productId: "product.yearly")
try await purchaseManager.updateProfileAttributes(attributes: PurchaseProfileAttributes(mixpanelDistinctId: mixpanelId))This package is used via SwiftfulPurchasing. See the parent package's .claude/swiftful-purchasing-rules.md for usage guidelines and integration advice for projects using Claude Code.
- iOS 17.0+
- macOS 14.0+
SwiftfulPurchasingRevenueCat is available under the MIT license.