PromptForProductKey()Answered

I tried to use NodeJS. I have a question about function PromptForProductKey() from main.js

Which is the same as this at the site I think:

https://wyday.com/limelm/help/using-turboactivate-with-electron-nodejs/#prompt-pkey

Where exactly I should use function PromptForProductKey()? This should be before:

ta.IsGenuineEx(DaysBetweenChecks, GracePeriodLength, true), right?

And with which function would be the best to check is it already activated before use PromptForProductKey(), is it ta.IsActivated()? In the case I do not want to run multiple times PromptForProductKey()?

Thank you.

Answer

If the customer is in trial mode then you should offer them the ability to prompt for a product key.

Meaning, if they're not activated (see the example article and code for the full meaning of that – namely, an IsGenuineEx() followed by an IsActivated()) then prompt them to activate. Part of that process can be prompting for a product key.

Does that make sense?

, edited

If after each run of app I want to decide whether to offer dialog to choose trial or activate, can I do something like this?:

 ta.IsActivated()
     .then((resolvedValue) => {

         if (resolvedValue===1) {
           PromptForProductKey()
         }else{
           checkingProc()  /////  inside is ta.IsGenuineEx(DaysBetweenChecks, …
         }
     })
     .catch((error) => {
         //Handle any potential errors
     });

, edited

No, you should follow the example. Only when you get to the UseTrial call should you prompt for a product key.