Mac SDK Setup

  • 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

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.

  • 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.
  • 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.

Add the Paddle framework to your Xcode project by dragging from the Finder.

Within Build Phases add a build phase (New Copy Files Build Phase). Make sure Destination is set to Frameworks.

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.

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.

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.

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.

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.