LicenPro
Documentation.NET SDKOffline cache & grace periods

Offline cache & grace periods

Expiry grace, offline files, and what happens when the API is unreachable.

GracePeriodManager lets an expired license keep running for GracePeriodDays (default 0, off). It covers genuine expiry only — a license on the wrong device or with the wrong key is never accepted — and its start time is stored on the device, so restarting the app does not begin a new grace period.

Device time (SDK 1.11). Every expiry, trial and grace decision uses a clock that never runs backwards: the later of the system clock and the latest time the device has seen, kept encrypted and moved forward by the server. Setting the clock back gains nothing; a customer who corrects a wrong clock is never blocked. A trial ends at the date signed in its license file; when you extend or end a trial on the server, the device learns it at its next online check through a lease the server signs with the product key.

Renewals reach the app (SDK 1.13). Every validation and heartbeat answer carries the license's current end date, signed by the server with the product key for that license and device. When you renew or extend a subscription, change a license's end date or extend a trial, the app uses the new date at its next validation or heartbeat: License.ExpirationDate and the subscription warning follow it, and the customer needs no new license file. An earlier end date applies the same way. An end date signed with another key, or for another license or device, is ignored. A trial license file always ends when the license ends, whenever it is downloaded.

Offline (file) licenses check in with the server the first time they run on each machine. From SDK 1.13, ValidateAsync and the cached validation (TryAutoValidateAsync) also ask the server whenever it can be reached, so a revoke, a suspension or a renewal reaches the device. Without a network the app waits at most 4 seconds for the server, then validates from its file and cache; after a try with no answer it does not ask again for 5 minutes. ValidateOfflineAsync never contacts the server.

Offline check-in

In Product → Settings → Offline check-in you can require offline devices to reach the server every N days (off by default). After a missed check-in the app keeps working for the grace period you set, then validation returns CheckInRequired ("Connect to the internet to keep using this app") until the device connects once. A revoked license or a blocked device stops at that check. It needs apps built with SDK 1.11 or later and starts from each device's next online check; ValidateOfflineAsync still never calls the server, but stops once the grace period is over.

Online licenses need the server. If https://licenpro.runasp.net/api is unreachable at validation, validation fails: OfflineCacheManager records successful online validations, but there is no automatic fallback to it yet. During a run, unanswered heartbeats raise SessionDisconnected with reason Unreachable.

Pair with the offline section in .NET SDK guide.