Remote License Verification

Remote verification and deactivation of SDK licenses

Getting Started

Once you have Trials and Licensing setup you can optionally verify licenses remotely with Paddle. This allows you to ensure that licenses and activations are legitimate as well as being able to deactivate licenses remotely.

If you are upgrading from a version of the SDK before version 3.0 your old licenses will automatically be remotely verified on app launch.

To remotely verify an activation simply call the verifyLicenceWithCompletionBlock method. This method will return, via a completion block, the verification status and optionally an NSError object. For example:


[paddle verifyLicenceWithCompletionBlock:^(BOOL verified, NSError *error) {
      if (verified) {
          NSLog(@"Verified");
      } else {
          NSLog(@"Not verified: %@", [error localizedDescription]);
      }
  }];

paddle.verifyLicenceWithCompletionBlock { (verified, error) -> Void in
        if (verified) {
            print("Verified")
        } else {
            print("Not Verified")
        }
    }

This will query the Paddle API for the status of the users license and can optionally deactivate/remove the license if it is not valid but will also allow a number of failed attempts before doing this (such as through not being able to reach the API).

By default the SDK does not automatically remove licenses and has a default failed attempt threshold of 75 attempts. You can easily change these values by using the shouldDestroyLicenceOnVerificationFail and failedAttemptsBeforeLicenceDestruction delegate methods. For example:


- (BOOL)shouldDestroyLicenceOnVerificationFail {
    return YES;
}

- (int)failedAttemptsBeforeLicenceDestruction {
    return 10;
}

func shouldDestroyLicenceOnVerificationFail() -> Bool {
    return true
}

func failedAttemptsBeforeLicenceDestruction() -> Int32 {
    return 10
}
Was this page helpful?