IsLicenseValid static method

int IsLicenseValid()

It verifies whether your app is genuinely activated or not. Returns LexStatusCodes LA_OK, LA_EXPIRED, LA_SUSPENDED, LA_GRACE_PERIOD_OVER, and LA_FAIL

The verification is done locally by verifying the cryptographic digital signature fetched at the time of activation. This is just an auxiliary function which you may use in some specific cases, when you want to skip the server sync. Note: You may want to set grace period to 0 to ignore grace period.

The function throws a LexActivatorException on error.

Implementation

static int IsLicenseValid() {
  int status = _lexActivatorNative.IsLicenseValid();
  switch (status) {
    case LexStatusCodes.LA_OK:
      return LexStatusCodes.LA_OK;
    case LexStatusCodes.LA_EXPIRED:
      return LexStatusCodes.LA_EXPIRED;
    case LexStatusCodes.LA_SUSPENDED:
      return LexStatusCodes.LA_SUSPENDED;
    case LexStatusCodes.LA_GRACE_PERIOD_OVER:
      return LexStatusCodes.LA_GRACE_PERIOD_OVER;
    case LexStatusCodes.LA_FAIL:
      return LexStatusCodes.LA_FAIL;
    default:
      throw LexActivatorException(status);
  }
}