https://docs.coronalabs.com/guide/monetization/IAP/index.html
https://developer.android.com/google/play/billing/billing_testing.html
Google Play > Developer Console
https://play.google.com/apps/publish/Home
click CREATE APPLICATION button and fill the mandatory data fields of each section with your answer
- Pricing & Distribution
- ContentRating
- Store > listing
- screenshots
- Hi-res icon 512 x 512 PNG
- Feature Graphic 1024 w x 500 h
2 screenshots are required. Minimum dimension of 320 px and a maximum dimension of 2840 px, for instance
- phone: 1080x1920
- tablet 7": 1024 x 600
- tablet 11": 1920 x 1200
Products
For instance, you are going to make IAP products like this
name | type | product id |
---|---|---|
book01 | Managed | com.kwiksher.bookshelf.book01 |
book02 | Managed | com.kwiksher.bookshelf.book02 |
Build apk
You need a keystore file for IAP and use it for building .apk with Corona simulator
keystore file
syntax
sudo keytool -genkey -v -keystore yourapp.keystore -alias yourapp -keyalg RSA -validity 10000
for example,
sudo keytool -genkey -v -keystore kwikbookshelf.keystore -alias kwikbookshelf -keyalg RSA -validity 10000
- fist and last name: Naoya Yamamoto
- origanizational unit: IT
- orignization: Kwiksher
- city or Locality: Akihabara
- state or province: Tokyo
- country code: jp
In Windows it is in JDK
- C:\Program Files (x86)\Java\jdk1.8.0_131\bin\keytool.exe
you may use Android Studio to make .jks
build.settings and config.lua
the IAP plugin and the permissions are added in build.settings
Your app’s key must be added to the license table in config.lua. copy it from Google Play Console > Your App > Monetization setup and paste it to config.lua
build.settings
settings = {
plugins = {
--Google in app billing v3
["plugin.google.iap.v3"] = {
-- required
publisherId = "com.coronalabs",
supportedPlatforms = { android = true },
},
},
android = {
usesPermissions = {
"android.permission.INTERNET",
"android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE",
"com.android.vending.BILLING",
},
},
config.lua
application =
{
license =
{
google =
{
key = "YOUR_KEY",
},
},
}
Google Play > Developer Console
OPT-OUT means uploading the apk built and signed with the keystore with Corona simulator. Instead you can opt in with .aab file
-
Your App > releases > Production or Testing
- Closed testing > Create track
- Manage Track > Edit
-
Upload apk
-
Monetize > In-app products > Add New Product
- Managed Product
- ID: com.kwiksher.bookshelf.book01
- Managed Product
- ID: com.kwiksher.bookshelf.book02
- Managed Product
Roll out the APK release to Production or Testing track for google to approve it. The status will become published in minutes. This is how to active your In-App products.
Prepareing Test Account
Google Play Console
- All apps > Settings > License Testing
- YourApp > Testing > Open testing, Closed Testing … > Manage track > Testers
- Opt-in URL will be available when you publish your app
- It takes some minutes for Google to approve your release after you rollout the app
Browser Google
-
create a new gmail account
[original] foo@gmail.com
[test accounts]
Device
- Settings > Users
- add new user with the new Gmail account
-
login the device with the new user
-
open the Opt-in URL in browser.
-
YourApp > Release > Production or Testing
-
Closed testing > Track > Testers
How testers join your test
- follow the instruction on the URL page to be the tester if the app
-
-
during the test purchase, it will be necessary to enter credit card information
-
- adb install the apk with the same version number to the device
- now you can test.
- clear data of Play store app on device from settings > App if you like to refresh testing
http://www.techotopia.com/index.php/An_Android_Studio_Google_Play_In-app_Billing_Tutorial
(Optional) Testing with Static Responses
you can build your .apk with the reserved product id of google to test IAP with the static responses before you use the commercial product IDs that you added in Google Play Console
-
android.test.purchased
-
android.test.canceled
-
android.test.refunded
-
android.test.item_unavailable
https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test
Note
- event.transaction.state with “refunded”
https://docs.coronalabs.com/guide/monetization/IAP/index.html#initialization
event.transaction.state within the transaction listener function will be “refunded” and, in this case, you can disable the content that was refunded and/or delete it from the app locally if it was downloaded. This features is not currently implemented with Kwik. You need to make external code for it.
notes
opt -in
-
Export from Java keystore: PEPK tool to encrypt the local key, command line instructions and uploading the final file.
-
upload the key
-
build the app with the keystore
-
upload aab
https://forums.solar2d.com/t/releasing-a-game-on-google-play-store/351496/2
-
New application signing from Google Play store side is used for the new distribution bundle used called android app bundle (.aab) which you upload and from there multiple apks are generated so that your users get the optimised apk to reduce the delivery size. https://developer.android.com/platform/technology/app-bundle
-
Solar2D supports the generation of .aab and .apk file. You can download the stable online builds (https://developer.coronalabs.com/downloads/coronasdk 1) and download 2020.3583 or the future builds where solar2D builds are headed towards offline build (https://github.com/coronalabs/corona/releases/) i.e. it will not require online connection to build the distribution files except for downloading the plugins you use in your app. *NOTE the offline builds are still in alpha stage and requires testing, if you are going to release app urgently then I would suggest the online builds but later on try testing the new build methods and if you find any issue just post it on github project issue or here, as the developer is still developing actively.
-
It is preferred to use production keystore when you release apps to different stores for security purpose as the debug keystore is available for everyone to download freely. If you require debug info you can override in the build file not to strip debug info but remember info about app may be shown to the end user. For the process https://docs.coronalabs.com/guide/distribution/advancedSettings/index.html#build-control
-
There are paths for the new distribution method by google play store (.aab). If your app is brand new the process is easy you just agree in the release tabs to use google play store’s keystore bundling after you upload the .aab the file. For existing apps in the play store you need to at first agree to let google play store use custom keystore and then you upload the .aab file, your new installs will use apk derived from the .aab file and exisiting users will receive the keystore you already used before. With .aab you also need to update your icons as well, for the full guide read this https://coronalabs.com/blog/2019/07/23/android-64-bit-is-here/ and https://coronalabs.com/blog/2020/04/16/google-64-bit-deadline-coming-august-1-2020/
-
You still need your keystore to upload the .aab files for new or existing apps. One of the benefit of switching is that if you lose your keystore, you can request play store to receive another keystore to identify the developer. (This has to be used sparingly, I think there is a limit as well, best thing to do is store your keystore securely with multiple backups).
License Key
Monetization setup

Closed testing for Opt-out



Tester
All apps > Settings

Your app > Testing
