Mac SDK Setup
Mac SDK support is limitedThe Paddle Mac SDK is only available for existing Paddle Classic accounts.
Integrate Paddle's SDK into your Xcode project
Requirements
- The Mac v4 SDK requires High Sierra (OS X 10.13) or above
- The SDK is written in Objective-C but also has a Swift interface
- The user's OS must support TLS 1.2
Downloads
Overview
Paddle’s Mac SDK has two primary components: the main Paddle
class where most functions are centralized and the PADProduct
class which represents a Paddle product for you to work with them in your app.
Paddle Singleton (Paddle
)
Paddle
)- The base class of the Paddle SDK. This is responsible for configuration and control, initialize the SDK, control the UI, and trigger actions like license recovery.
Paddle Product (PADProduct
)
PADProduct
)- A local representation of a Paddle product or subscription, with details including remaining trial days, activation date, prices and actions on the Product to refresh its data from the seller dashboard and verify or deactivate a license.
- Paddle Products have a dependency on the Paddle Singleton, please ensure you initialize the singleton first.
- You can have multiple PADProduct instances for multiple product IDs instantiated at once.
Xcode Setup
1. Add to Project
Add the Paddle framework to your Xcode project by dragging from the Finder.
2. Add to Target
3. Copy Files
Within Build Phases add a build phase (New Copy Files Build Phase). Make sure Destination is set to Frameworks.
4. Sandbox Settings
If your app is sandboxed you should enable "Outgoing Connections (Client)" in your Signing & Capabilities tab to allow the framework to send data to Paddle.
5. Hardened Runtime Settings
If your app has hardened runtime, you will need to enable "Allow Execution of JIT-compiled Code" in your Signing & Capabilities tab to allow the framework to work correctly.
6. Initialize Product
The Paddle SDK requires that you initialize it with an SDK Product, which you’ll need to create via the Vendor Dashboard. Once initialized you can work with any type of Product or Subscription, we’ll never assume the SDK Product used to initialize the SDK is the relevant one.
Import the Paddle Singleton to your class:
Then configure and initialize the SDK and your Product.
Sandbox Environment
You can use Paddle's sandbox environment to test your SDK integration.
If you don't have a sandbox account yet, you can create one here.
To use the sandbox environment on the SDK you will need to use [Paddle setEnvironmentToSandbox];
method before calling any startLicensing
methods, preferably in applicationDidFinishLaunching:
and change the vendor id, product id and API key to the sandbox values.
Please note that the sandbox environment only works with one-off SDK products.
Debug Mode
Enable Paddle's debug mode in your app by adding the following line:
Debug mode prints more verbose information and error messages to the console while the app is running and also adds an additional app menu, allowing you to reset or expire app trials.