moisoni97/google-inapp-billing
Get the source
Checkout: https://github.com/moisoni97/google-inapp-billing Open it in Android Studio
Update gradle
Change the Google IAP library dependency in google-iab/build.gradle
like this:
implementation 'com.android.billingclient:billing:5.0.0'
for:
releaseImplementation 'com.android.billingclient:billing:5.0.0'
debugImplementation "dev.iap.android.billingclient:billing_5_1:1.0.0"
Setup iap.dev project
Go to https://console.iap.dev
- Create an organization, call it "moisoni97"
- Create a project, call it "google-inapp-billing"
- Create the following products/subs (As referenced in JavaSampleActivity):
// consumable
"consumable_id_1"
"consumable_id_2"
"consumable_id_3"
//non-consumable ids
"non_consumable_id_1"
"non_consumable_id_2"
"non_consumable_id_3"
// subscription ids
"subscription_id_1"
"subscription_id_2"
"subscription_id_3"
Initialize the SDK
By calling:
IapDevConfiguration configuration = new IapDevConfiguration.Builder("<Your project's clientKey> ", "<Your project's clientSecret>")
.build();
IapDev.setup(configuration);
In games.moisoni.google_inapp_billing.JavaSampleActivity
change the following line:
86: billingConnector = new BillingConnector(this, "license_key") //"license_key" - public developer key from Play Console
You can get the key from the https://console.iap.dev Note: it should be a single line, not to be confused with the ClientKey