Skip to content

SwiftfulThinking/SwiftfulPurchasingRevenueCat

Repository files navigation

SwiftfulPurchasingRevenueCat

Add RevenueCat support to a Swift application through the SwiftfulPurchasing framework.

Setup

Details (Click to expand)

Add SwiftfulPurchasingRevenueCat to your project.

https://github.com/SwiftfulThinking/SwiftfulPurchasingRevenueCat.git

Import the package.

import SwiftfulPurchasingRevenueCat

Configure PurchaseManager with RevenueCatPurchaseService:

#if DEBUG
let purchaseManager = PurchaseManager(service: MockPurchaseService(), logger: logManager)
#else
let purchaseManager = PurchaseManager(service: RevenueCatPurchaseService(apiKey: revenueCatApiKey), logger: logManager)
#endif

Example Actions

You 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))

RevenueCat Documentation

Claude Code

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.

Platform Support

  • iOS 17.0+
  • macOS 14.0+

License

SwiftfulPurchasingRevenueCat is available under the MIT license.

About

RevenueCat for SwiftfulPurchasing

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages