Silent Licensing

Silent Licensing allows you to use the functionality of the Paddle SDK with your own UI

Legacy Version

V3 of the Paddle Mac SDK is a deprecated version and sellers implementing the SDK for the first time are encouraged to download and implement our latest version.

Getting Started

To start using silent licensing you should follow the normal steps in Trials, Licensing & Checkout, but instead of calling the standard startLicensing method you should instead use startLicensingSilently. This will internally begin the licensing process and allow you to use activate, purchase and trial methods without the need to present the Paddle SDK UI. For example:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
	    NSDictionary *productInfo = [NSDictionary dictionaryWithObjectsAndKeys:
	         @"10.00", kPADCurrentPrice,
	         @"Test Developer", kPADDevName,
	         @"USD", kPADCurrency,
	         @"http://www.macupdate.com/util/iconlg/17227.png", kPADImage,
	         @"Test Product 2", kPADProductName,
	         @"7", kPADTrialDuration,
	         @"Thanks for downloading a trial of our product", kPADTrialText,
	         @"paddleicon.png", kPADProductImage, //Image file in your project
	         nil];
	
	    [[Paddle sharedInstance] startLicensingSilently:productInfo timeTrial:YES];
}

Once you have started the silent licensing process you can use other methods, such as productActivated or daysRemainingOnTrial as usual.

Activating a License

To activate a license without presenting the Paddle SDK UI you can use the activateLicence withCompletionBlock: method, passing in the entered license code and customers emails address. For example:

[[Paddle sharedInstance] activateLicence:@"abc123" email:@"test@example.com" withCompletionBlock:^(BOOL activated, NSError *error) {
        if (activated) {
            NSLog(@"Product Activated");
        } else {
            NSLog(@"Product Not Activated: %@", [error localizedDescription]);
        }
    }];

Purchasing a License

You can also launch a purchase window for your customer to purchase a license for your app. This will launch the purchase window from the SDK but will not present any other windows. You can do this using the startPurchaseWithWindow: completionBlock: method. This will accept a window parameter if you wish the window to be presented as a sheet attached to your window, and will return both a licenceCode and an email parameter. It will also return an activate parameter, which informs you if you should present an activate license window or not. For example:

[[Paddle sharedInstance] startPurchaseWithWindow:nil completionBlock:^(NSString *email, NSString *licenceCode, BOOL activate) {
        if (activate && licenceCode) {
            //Auto activate returned license
            
        } else if (activate) {
            //Show activate license UI
            
        } else {
            //No license and user has not clicked enter license (Cancelled)
            
        }
    }];

Deactivating a License

Deactivating a license is as simple as using the deactivateLicenceWithCompletionBlock: method. If successful it will return a deactivated BOOL value to indicate this. For example:

[[Paddle sharedInstance] deactivateLicenceWithCompletionBlock:^(BOOL deactivated, NSString *deactivateMessage) {
        if (deactivated) {
            NSLog(@"Product Deactivated");
        } else {
            NSLog(@"Product Not Deactivated");
        }
    }];