Skip to content

Commit a1f9641

Browse files
atamanataman
authored andcommitted
2 parents 2b699c7 + f3dca7b commit a1f9641

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# Android_Billing_v4up_PurchaseManager
2-
Android Billing v4+ implementation for non consumable products. Written in Kotlin using coroutines. Serverless verifying approval method of a purchased token. No UI sample.
2+
Android Billing v4+ implementation for non consumable products. Written in **Kotlin** using coroutines. Serverless verifying approval method of a purchased token. No UI sample. Android IAP Library.
3+
4+
[An official integration.](https://developer.android.com/google/play/billing/integrate#kotlin)
5+
[And a sample.](https://github.com/android/play-billing-samples/blob/master/TrivialDriveKotlin/app/src/main/java/com/sample/android/trivialdrivesample/billing/BillingDataSource.kt)
6+
7+
*My implemenation is much easy to use, you can adapt it also for subscriptions and for consumable products.*
8+
*PurchaseManager.kt is well documented.*
9+
10+
## Preparing:
11+
* **First put your developer Base64-encoded RSA public key (from Google Play Console: your app -> monetization setup) in: /local.properties/base64EncodedPublicKey=YOUR_KEY**
12+
* **In order to test billing - Release your application with an integrated billing library but not yet implemented to any testing track (internal testing is better). Just adding 'com.android.billingclient:billing:4+' is enough at this stage.**
13+
* **For debugging testing: in Google Developers Console (Not Play Console) add your debug key SHA1.**
14+
* **In Google Play Console create a testers group.**
15+
16+
## How to use:
17+
**All methods of PurchaseManager must be called from the main ui thread.**
18+
1. Call init(activity: Activity, listener: PurchaseListener) from Activity.onCreate(..). Via PurchaseListener you will receive available products to purchase, a purchased items, a result from the recent purchase.
19+
2. Call onResume() from Activity.onResume()
20+
3. Call dispose() from Activity.onDestroy()
21+
4. IAP methods: getItemPrices() and purchaseItem(itemType: PurchaseType)
22+

gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)