When you publish your Blocks app in the Wix App Market, you can choose to provide different app behaviors for site-creators with different pricing plans. People who download a free version of your app may get several services, while those who pay for it, get more. This requires creating and managing a system that identifies the user, determines their pricing plan and impacts the app's behavior (learn more about adjusting your Blocks app to a pricing plan).
This example application elegantly counts up until a desired number (the numbers move like in a slot machine). Click Build in Blocks to create your own copy of this application, inspect it and use it as you wish.
Our application has three pricing plans:
Your copy of the application includes:
Your copy does not include the following (define them on your own):
Let's dive into the application and see how it was built.
The first step was to create the UI in Blocks. We also created 4 different design presets.
Then, we imported the wix-application
module to our widget code.
We used getDecodedAppInstance()
to save the vendorProductId
(learn more).
We used the delete()
and restore()
functions to delete and restor the watermark and icon according to the pricing plan.
Here is part of the widget code: