License Activation (Mac)

The Paddle Mac SDK has a flexible licensing implementation that allows you to use our full solution, just our platform for issuing and validation, or roll your own entirely.

Using Paddle licenses to manage app access requires creation of a Paddle SDK Product in your seller dashboard, or enabling Paddle licensing on a recurring subscription plan.

Activation Dialog

The SDK provides a standard license activation dialog, which can be invoked whenever the app is found in an unlicensed state:

The product access dialog is triggered by calling the showProductAccessDialogWithProduct method. See example below:

// Create the Product we want to work with
PADProduct *paddleProduct = [[PADProduct alloc] initWithProductID:@"12345"
                                                      productType:PADProductTypeSDKProduct
                                                    configuration:nil];

// Refresh to ensure we've got up to date information locally for the product
// Remote values will supersede local
[paddleProduct refresh:^(NSDictionary * _Nullable productDelta, NSError * _Nullable error) {
    [paddle showProductAccessDialogWithProduct:paddleProduct];
}];

Programmatic (“Silent”) Activation

If you’re making use of our licensing but want to use your own UI, you can make the activation call manually and handle the result as follows:

[paddleProduct activateEmail:@"example@email.com"
                     license:@"ABCD-EFGH-IJKL-MNOP"
                  completion:^(BOOL activated, NSError * _Nullable error) {
	// Handle the activation result
}];
Automatic Post-Purchase Activation

Programmatic activation can be used to retrieve a license key returned in a checkout completion block and automatic and automatically activate the license. This saves the user the job of copying and pasting the license into the activation dialog and can reduce the volume of licensing-related support requests.


License Custom Path (Mac)

License custom path allows you to choose where you want the license to be stored.

customStoragePath is a delegate method that has been introduced in v4.0.13 that allows you to choose where the user license should be stored. E.g., if you would like the license to be accessible for all users on a certain machine you would store the license at /Users/Shared.

Set delegate to self :

	// Initialize the SDK Instance with Seller details:
Paddle *paddle = [Paddle sharedInstanceWithVendorID:myPaddleVendorID
											 apiKey:myPaddleAPIKey
										  productID:myPaddleProductID
									  configuration:defaultProductConfig
										   delegate:self];
}];

Add the customStoragePath delegate method:

- (NSString *)customStoragePath {
    return @"/Users/shared"; //Needs to be full path to custom storage directory
}