Hi,
I'm trying to use the license API for a plugin I'm developing. I could add some features as enabling all license management though "Manage add-ons" section, following this tutorial: https://developer.atlassian.com/market/add-on-licensing-for-developers/tutorial-adding-licensing-support-to-your-add-on
In spite of this, the rest of documentation is very confusing, showing another way to add licensing support, including an automatic control to disable the plugin when license is invalid. I ran into an error trying to use the atlas-create-jira-plugin-module as this documentation shows: https://developer.atlassian.com/market/add-on-licensing-for-developers/licensing-api-overview
What is the best way to add licensing support and check if it's valid? Why is this documentation so confusing and controversial? Am I missing something?
Thanks in advance!
Community moderators have prevented the ability to post new answers.
Hi Admin!
The article under the first link is sufficient so you can ignore rest of the documentation. When you have upm dependencies in your pom you can use flowing code snippet for checking the license:
/** * LicenseManager */ @Autowired // or inject through the constructor params private PluginLicenseManager licenseManager; ... private boolean isLicenseOk() { if (licenseManager.getLicense().isDefined()) { PluginLicense pluginLicense = licenseManager.getLicense().get(); /* Check and see if the stored license has an error. */ if (pluginLicense.getError().isDefined()) { /* A license is currently stored, however, it is invalid (e.g. expired or user count mismatch) */ licenseError = i18nHelper.getText("work-calendar.license.errors.invalid"); return false; } else { return true; } } else { /* No license */ licenseError = i18nHelper.getText("work-calendar.license.errors.noLicense"); return false; } }
Here are licenses you can use for testing: https://developer.atlassian.com/market/add-on-licensing-for-developers/timebomb-licenses-for-testing
Your are totally right! I figure this out some weeks ago. I just think the documentation must be clearer. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Related question: Is there any recommended way of developing and testing your plugin while licensing is enabled? There is no infinite test license, so it gets disabled after 3 hours. I'd prefer not to have to disable and enable bits of code responsible for license validation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For new plugin you have to disable/enable. For published plugin that on the marketplace I generate trial license.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, do you mean disable/enable licensing manually in the code, or something else? Also, I haven't published the plugin yet (as you can tell from the questions), but I assume there's a way of generating trial licenses from the atlassian console.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tomek Klas ! I comment/uncomment in the code. Please let me know if you find out how to generate the license in the console.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. I now have service that checks the license and a magic variable that disables licensing, so it should be fine as long as I'll remember to change it before final testing and release :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.