<body>
from the www/index.html
file with the below.'unsafe-inline'
Content-Security-Policy
by adding it to the default-src
section:nonconsumable1
. We declare it as a non-consumable (store.NON_CONSUMABLE
). ⇒ API Documentation.window.localStorage.unlocked
#locked
html element:nonconsumable1
that we registered in the initialization code above.initStore()
function, line 20.refreshProductUI()
function at the bottom of the file.purchaseNonConsumable1
button.canPurchase
state of the product will change to false
. But remember, we added this in the previous step:canPurchase
changes, it will not be possible to hit Purchase, until canPurchase
becomes true again.approved
event, let's handle it by adding the below to the initStore()
function, before the call to store.refresh()
.finishPurchase
function at the end of our JavaScript file.initStore()
function, anywhere before the initial store.refresh()
. Also add the recommended Content-Security-Policy
to your index.html
as mentioned in the documentation.