What is RevenueCat?
RevenueCat is an in-app subscription platform that makes it easy to build and manage IAPs on any platform. With the RevenueCat SDK, you can build and manage your app business on any platform without having to maintain purchase infrastructure. You can read more about how RevenueCat fits into your app or you can sign up free to start building.
Requirements
Xcode 12+
Minimum target: iOS 9.0+
Installation
Purchases for iOS can be installed either via CocoaPods, Carthage, or Swift Package Manager.
Install via CocoaPods
Add the following to your Podfile:
Always use the latest release:
pod 'Purchases'
Alternatively, pin to a specific minor version (e.g. 3.10):
pod 'Purchases', '~> 3.10'
And then run:
pod install
This will add Purchases.framework
to your workspace.
Install via Carthage
Add the following to your Cartfile:
Always use the latest release:
github "revenuecat/purchases-ios"
Alternatively, pin to a specific minor version (e.g. 3.10):
github "revenuecat/purchases-ios" ~> 3.10
And then run:
carthage update
Note: We recommend using Carthage versions >= 0.37.
Carthage versions < 0.37 have a bug which makes usingcarthage update --no-use-binaries
produce build issues on Xcode 12. More information on this issue is available here http://github.com/Carthage/Carthage/issues/3019.
Carthage with XCFrameworks
If you're using Carthage version >= 0.37, you can use Purchases as an XCFramework instead of a Universal Framework. This makes setup easier, since you don't have to set up build phases at all.
To use XCFrameworks with Carthage, you need to pass in --use-xcframeworks
and --no-use-binaries
.
carthage update --no-use-binaries --use-xcframeworks
More information on using XCFrameworks with Carthage is available at https://github.com/carthage/Carthage/#building-platform-independent-xcframeworks-xcode-12-and-above
Install via Swift Package Manager
You can use Swift Package Manager to add Purchases to your Xcode project. Select File Β» Swift Packages Β» Add Package Dependency...
and specify the repository URL of the Purchases
library: https://github.com/RevenueCat/purchases-ios.git. Set the version to Up to next major
and choose the target where you want to use it. The library should have been added to the Swift Package Dependencies section and you should be able to import it now.
Importing Purchases
You should now be able import Purchases
import Purchases
#import "Purchases.h"
Enable In-App Purchase for your project
Don't forget to enable the In-App Purchase capability for your project under
Project Target -> Capabilities -> In-App Purchase


Next Steps
- Now that you've installed the Purchases SDK in your iOS app, get started by configuring an instance of Purchases
Updated about 2 hours ago