Integration
After you’ve developed your app, go to the Author Dashboard and add a product you will be integrating licensing to. You will need to do three things:
Save the product as a draft
Note the ID for the product at the top of page
Add licensing into your assembly, compile and upload files
The product ID is the identifier of your product which is to be used in the code.
Adding the licensing library to your app
You will need to download the Licensing library and add it as a reference in your app.
Validate licensing library origin
External libraries might be a subject of tampering by hackers to work around the licensing infrastructure. It's a good practice to validate its origin by comparing the code signature and making sure it hasn't tampered before executing any functions.
This doesn't apply to the cTrader platform and trying to validate its origin using the method above won't work.
Add item attributes
Those attributes serve as important data during communication with our licensing server. Make sure that these attributes are correct, and the version is up to date.
Create item license object
At the beginning of your app life cycle, you need to create an item license object where you pass your main class object with item attributes as a parameter.
Verify license validation
The next thing you need to do is to check the license status. If the license is not valid, then a window will pop out asking for License Activation. If the user fails to validate his purchase, you will want to terminate the app or take some other action.
Check if the user is running a trial period
Optionally, you might want to check if the user is running the Free 7-day trial and make some features not available or limited to demo trading accounts only.
You can do these checks as often and as many times as you need. The license validation process is done on the background asynchronously and syncs the status with our servers periodically.
Last updated