SDKs
...
Licensing Scenarios
License Type Options
Subscription
10min
in this guide, we'll delve into the realm of subscription licensing, accompanied by licensespring's powerful sdks whether you're a seasoned developer or just beginning, this tutorial will equip you to seamlessly integrate subscription licenses into your software offerings prerequisites completed the getting started docid\ lsfy9tq3vfq4roow9shkd tutorial, including initialized licensemanager (or licensehandler ) with your configuration using the appropriate settings created a licenseid using either licenseid fromkey or licenseid fromuser function, depending on the activation method you prefer activated a license of any type interpreting and retrieving validity period similar to time limited licensing, you gain the ability to set the default validity period for generated license keys this validity period signifies the duration in days between the initial activation of the license key and its expiration with subscription licenses, however, there exist getters for the validity period including the grace period just like with time limited licenses, the sdks offer the ability to retrieve these fields in local time and utc tm licensespring license validitywithgraceperiod() tm licensespring license validitywithgraceperiodutc() datetime licensespring license validitywithgraceperiod()	 datetime licensespring license validitywithgraceperiodutc() license validity with grace period() interpreting and retrieving grace period grace periods offer you the flexibility to determine a specific timeframe, measured in hours, subsequent to the expiry of the designated validity period during this defined interval, the license will retain its validity ( isexpired() status will remain false), ensuring a seamless transition even after the official expiration to access the current license's grace period, developers can use the following uint32 t licensespring license subscriptiongraceperiod() uint licensespring license subscriptiongraceperiod() integer getgraceperioddays()// obtain grace period license graceperiodlicense subscription grace period() note c++ and c# grace period retrieval returns the time remaining in hours , while the java implementation returns days remaining it is also possible to check whether the grace period has started through bool licensespring license issubscriptiongraceperiodstarted()bool licensespring license issubscriptiongraceperiodstarted() license is subscription grace period started() how to verify if a license has expired by employing our system, you can easily determine whether a license has expired or remains valid this process empowers you with accurate information to manage software access effectively, ensuring a seamless user experience utilizing the "isexpired" method to check license expiry the isexpired() method provides an efficient way to check whether a license has reached its expiration date our sdks offer the ability to check the expiration status through the use of the following license methods bool licensespring license isexpired()bool licensespring license isexpired() boolean isexpired()license isexpiredlicense is expired() note our java sdk's isexpired() method is called on the licensedata object implementing local checks for license expiry a local license check involves assessing the validity and expiration status of a software license within the immediate operating environment by performing checks locally, the software verifies the license's authenticity and expiration status without relying on external connections if the local license is expired, the sdks will throw the following exceptions licensestateexceptionlicenseexpiredexceptionlicenseexpiredexceptionlicensestateexception see license checks docid\ ie dah13b4dqxmaqoygrj for more information about local license checks understanding the "days remaining" value developers can also access a field within the license object that holds the number of days remaining until the license expires this number of days can be retrieved using the following methods, in the current time zone and utc, respectively int licensespring license daysremaining() int licensespring license daysremainingutc()int licensespring license daysremaining()	 int licensespring license daysremainingutc() long daysremaining()license days remaining() note the java sdk only offers the ability to retrieve the days remaining in the current time zone