# License activation not triggering notifyLicenseStateChanged()

**URL:** <https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659>\
**Category:** Module Development\
**Tags:** ignition80\
**Created:** [September 14, 2020, 5:51pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659 "2020-09-14T17:51:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 14, 2020, 5:51pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/1 "2020-09-14T17:51:09Z")

</div>

Hello,

I figured out the licensing and applied a CD-KEY to my module.

When I click activate in the gateway, the licenseManager outputs to the log that it has received the CD-KEY.

I had assumed that notifyLicenseStateChanged(LicenseState licenseState) would then catch that the licenseState had changed, so I could then do whatever I want from there with licenseState.getLicenseMode().

However, the log.info("{}", licenseState.getLicenseMode()) output never is sent to console, so notifyLicenseStateChanged() is not firing.

Is there something I am missing here? Tried looking through the forums.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/11552278fbfd62e681bd1355810d0c7bfd392496.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/50264b54372672085a30f6ab5abc43a700f34cae.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 14, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/2 "2020-09-14T18:10:04Z")

</div>

Did you attach your module’s ID to the license? I’ve forgotten that before… 😳

---

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 14, 2020, 6:14pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/3 "2020-09-14T18:14:21Z")

</div>

Good question. I think so? In my licensing page I have this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/b/4bc81cf13b95ed4f4e05b4cbbd444a6070c6f661.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 14, 2020, 6:17pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/4 "2020-09-14T18:17:01Z")

</div>

Try restarting your module and see if the license comes through on the startup call. Also look for typos in your module ID in either your module.xml file or in your license management.

---

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 14, 2020, 8:22pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/5 "2020-09-14T20:22:11Z")

</div>

My ignition gateway is in trial mode. Is this the issue?

Will I never get licenseState.getLicenseMode() == LicenseMode.Activated if the gateway is running in trial, even though I have activated my module with a CD-KEY?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 15, 2020, 11:59am UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/6 "2020-09-15T11:59:38Z")

</div>

Correct. You must have a platform license before you can use secondary licenses.

---

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 15, 2020, 12:40pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/7 "2020-09-15T12:40:14Z")

</div>

So then once I have the platform license, with getLicenseMode() only return LicenseMode.Activated if my module is activated? How does it differentiate between the platform and the secondary?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 15, 2020, 12:42pm UTC](https://forum.inductiveautomation.com/t/license-activation-not-triggering-notifylicensestatechanged/38659/8 "2020-09-15T12:42:16Z")

</div>

You buy a platform license from IA. It knows that it is a platform license. IIRC, the cheapest platform license is when you buy just the OPC/UA server module.
