License verification (Mac)
When working with licensing we recommend that you periodically verify activated licenses with our platform, to confirm that they are still active and valid.
Check License Validity
Section titled “Check License Validity”Verify a license’s activation state as follows:
if (paddleProduct.activated) { [paddleProduct verifyActivationWithCompletion:^(PADVerificationState state, NSError * _Nullable error) { // Examine the verification state to determine the result of the verification attempt }];}if paddleProduct!.activated { paddleProduct?.verifyActivation(completion: { (state: PADVerificationState, error: Error?) in // Examine the verification state to determine the result of the verification attempt })}Verification Frequency
Section titled “Verification Frequency”The frequency that you verify license activation state should take into consideration:
- How often your users start or restart your app
- How likely users are to be online or offline
- The financial or technical impact of allowing users to continue to use an app in without a verified license
License usage
Section titled “License usage”When calling verifyActivationDetailsWithCompletion the completion block will contain NSDictionary *verificationData, which contains usage values of the license being verified.
allowed_usestotal number of allowed activationstimes_usednumber of times the license has been activated
Note: This method has been introduced in v4.2
[product verifyActivationDetailsWithCompletion:^(PADVerificationState state, NSError * _Nullable error, NSDictionary *verificationData) {
//allowed_uses and times_used are available on verificationData
NSLog(@"%@", verificationData[@"allowed_uses"]);
NSLog(@"%@", verificationData[@"times_used"]);
}];