I'm going to integrate an extension with License API and it will have monthly fee (subscription charged per month). As I understand so far I will need to make verify the license call and check createdTime value, and if it is greater than 1 month I will need to show link to web store. And after if user will pay subscription in next call createdTime will be changed to current date (so, createdTime will show last payment date, will not?), am I right? I've searched the answer in documentation but so far could not find any info about it..
问题:
回答1:
According to documentation, the createdTime
value contains:
The date that the license was created, returned as a Unix timestamp. You can use to limit functionality of a free trial to a specific period of time.
The createdTime
value indicates the moment the user first installed the extension and it never changes, even if the user uninstalls and re-installs the extension, or changes from free trial to paid subscription.
You can check the accessLevel
value to see if the user has paid the subscription or not: "FULL"
indicates that the subscription is paid and active, "FREE_TRIAL"
indicates that the user hasn't paid. In the latter case, you can compare the createdTime
value to the current date to check if the user is still within the free-trial period or not.