BILLING_KEY
. That piece of information can be found on the Google Play Publisher Console.cordova plugin add
command. There is little subtleties on Android.BILLING_KEY
.cordova build android --release
with the correct command line arguments. It requires you have generated a keystore
file for your application already.alias
as release, you can use any value, but just remember the value you chose.android-release.keystore
file in a safe place, backup it everywhere you can! Don't loose it, don't loose the password. You won't EVER be able to update your app on Google Play without it!$KEYSTORE_ALIAS
and $KEYSTORE_PASSWORD
with whatever match your those from your keystore
file...<body>
from the www/index.html
file with the below.'unsafe-inline'
Content-Security-Policy
by adding it to the default-src
section:consumable1
. We declare it as a consumable (store.CONSUMABLE
). ⇒ API Documentation.window.localStorage.goldCoins
#gold-coins
html element:consumable1
that we registered in the initialization code above.initStore()
function, line 20.refreshProduct()
function at the bottom of the file.adb
, like this:adb logcat "chromium:I *:E"
android-release.sh
script has a shortcut that will build, install and start adb logcat
:purchaseConsumable1
button.canPurchase
state of the product will change to false
. But remember, we added this in the previous step:canPurchase
changes.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.