You can use Adapty SDK in Swift and Objective-C applications.
Add Adapty to your
Podfilepod 'Adapty', '~> 1.8.1'
And then run:
This creates an
.xcworkspace file for your app. Use this file for all future development of your application.
In Xcode go to
Swift Packages >
Add Package Dependency...
Enter the repository URL
Choose the version, and click
Next. Xcode will add the package dependency to your project, and you can import it.
And add the following to
Adapty.activate("PUBLIC_SDK_KEY", customerUserId: "YOUR_USER_ID")
Adapty configurational options:
Public SDK key (required): found in your app settings in Adapty Dashboard
App settings >
Customer user ID (optional): an identifier of the user in your system. We send it in subscription and analytical events, to attribute events to the right profile. You can also find customers by
customerUserId in the Profiles section.
If you don't have user IDs in your app, you can omit this parameter or pass null.
If you don't have a user ID at the time of Adapty initialization, you can set it later using
Observer mode (optional): a boolean value controlling Observer mode. Turn it on if you handle purchases and subscription status yourself and use Adapty for sending analytical events only.
Adapty logs errors and other important information to help you understand what is going on. There are three levels available:
none (default): won't log anything
errors: only errors will be logged
verbose: method invocations, API requests/responses, and errors will be logged
You can set
logLevel in your app before configuring Adapty.
Adapty.logLevel = .verbose
Adapty allows you to remotely configure the products that will be displayed in your app. This way you don't have to hardcode the products and can dynamically change offers or run A/B tests without app releases.