I always like to display the Ignition license key in all my applications. Currently i display the key as label from a tag in the Gateway i manually edit.
i there a way to query the internal ‘works’ of the gateway to get the actual key?
In a message handler, put the following
from com.inductiveautomation.ignition.gateway import SRContext
context = SRContext.get()
resp = {"primary key":None,"secondary keys":[]}
resp["primary key"] = str(context.getLicenseManager().getLicense().getCDKey().toString())
for key in context.getLicenseManager().getSecondaryLicenses():
resp["secondary keys"].append(str(key.getCDKey().toString()))
return resp
Now, invoke that with system.util.sendRequest or sendRequestAsync, and voila!
You should blur that CD key
oops, suppose you are correct. Can trust no one nowadays