{"id":17643807,"url":"https://github.com/vanniktech/rxbilling","last_synced_at":"2025-04-14T06:45:08.330Z","repository":{"id":37431731,"uuid":"137601924","full_name":"vanniktech/RxBilling","owner":"vanniktech","description":"Reactive wrapper around the Android Billing API","archived":false,"fork":false,"pushed_at":"2025-03-25T05:40:14.000Z","size":766,"stargazers_count":31,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T21:32:40.801Z","etag":null,"topics":["android","billing","rxjava"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanniktech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["vanniktech"]}},"created_at":"2018-06-16T18:29:04.000Z","updated_at":"2025-03-25T05:38:56.000Z","dependencies_parsed_at":"2023-12-22T10:41:58.011Z","dependency_job_id":"9e17225b-5c08-42b5-a92a-f35a7c0b68be","html_url":"https://github.com/vanniktech/RxBilling","commit_stats":{"total_commits":247,"total_committers":3,"mean_commits":82.33333333333333,"dds":"0.43724696356275305","last_synced_commit":"3ad35991870d343c74d5e3d2477fb76929eb4a3c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2FRxBilling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2FRxBilling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2FRxBilling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanniktech%2FRxBilling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanniktech","download_url":"https://codeload.github.com/vanniktech/RxBilling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837264,"owners_count":21169373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","billing","rxjava"],"created_at":"2024-10-23T09:42:56.962Z","updated_at":"2025-04-14T06:45:08.306Z","avatar_url":"https://github.com/vanniktech.png","language":"Kotlin","funding_links":["https://github.com/sponsors/vanniktech"],"categories":[],"sub_categories":[],"readme":"# RxBilling\n\nReactive wrapper around the [Android Billing API](https://developer.android.com/google/play/billing) that makes in app purchases and subscriptions really easy to handle. I've been using this library in my [apps](https://play.google.com/store/apps/developer?id=Niklas+Baudy) for years and it has been working nicely.\n\n# Usage\n\nThe core functionality is provided via an interface:\n\n```kotlin\ninterface RxBilling {\n  fun queryInAppPurchases(vararg skuIds: String): Observable\u003cInventoryInApp\u003e\n\n  fun querySubscriptions(vararg skuIds: String): Observable\u003cInventorySubscription\u003e\n\n  fun isBillingForInAppSupported(): Completable\n\n  fun isBillingForSubscriptionsSupported(): Completable\n\n  fun purchase(inventory: Inventory, developerPayload: String): Single\u003cPurchaseResponse\u003e\n\n  fun getPurchasedInApps(): Observable\u003cPurchasedInApp\u003e\n\n  fun getPurchasedSubscriptions(): Observable\u003cPurchasedSubscription\u003e\n\n  fun acknowledgePurchase(purchased: Purchased): Single\u003cInteger\u003e\n\n  fun consumePurchase(purchased: Purchased): Single\u003cInteger\u003e\n\n  fun destroy()\n\n  @interface BillingResponse {\n    const val SERVICE_TIMEOUT = -3\n    const val FEATURE_NOT_SUPPORTED = -2\n    const val SERVICE_DISCONNECTED = -1\n    const val OK = 0\n    const val USER_CANCELED = 1\n    const val SERVICE_UNAVAILABLE = 2\n    const val BILLING_UNAVAILABLE = 3\n    const val ITEM_UNAVAILABLE = 4\n    const val DEVELOPER_ERROR = 5\n    const val ERROR = 6\n    const val ITEM_ALREADY_OWNED = 7\n    const val ITEM_NOT_OWNED = 8\n    const val NETWORK_ERROR = 12\n  }\n}\n```\n\nThe actual [interface](./rxbilling/src/main/kotlin/com/vanniktech/rxbilling/RxBilling.kt) also contains documentation.\n\nThis library offers different implementations based on different Google Play Billing library versions.\n\n### Google Play Billing Library v7 implementation\n\n```groovy\nimplementation 'com.vanniktech:rxbilling-google-play-library-v7:0.10.0'\n```\n\n```java\nclass YourActivity extends Activity {\n  private RxBilling rxBilling;\n\n  @Override public void onCreate(Bundle savedInstanceState) {\n    super.onCreate();\n    rxBilling = new com.vanniktech.rxbilling.google.play.library.v7.RxBillingGooglePlayLibraryV7(this);\n    // Use rxBilling to call your desired methods.\n  }\n\n  @Override public void onDestroy() {\n    super.onDestroy();\n    rxBilling.destroy();\n  }\n}\n```\n\n### Google Play Billing Library v6 implementation\n\n```groovy\nimplementation 'com.vanniktech:rxbilling-google-play-library-v6:0.10.0'\n```\n\n```java\nclass YourActivity extends Activity {\n  private RxBilling rxBilling;\n\n  @Override public void onCreate(Bundle savedInstanceState) {\n    super.onCreate();\n    rxBilling = new com.vanniktech.rxbilling.google.play.library.v6.RxBillingGooglePlayLibraryV6(this);\n    // Use rxBilling to call your desired methods.\n  }\n\n  @Override public void onDestroy() {\n    super.onDestroy();\n    rxBilling.destroy();\n  }\n}\n```\n\n### Google Play Billing Library v5 implementation\n\n```groovy\nimplementation 'com.vanniktech:rxbilling-google-play-library-v5:0.10.0'\n```\n\n```java\nclass YourActivity extends Activity {\n  private RxBilling rxBilling;\n\n  @Override public void onCreate(Bundle savedInstanceState) {\n    super.onCreate();\n    rxBilling = new com.vanniktech.rxbilling.google.play.library.v5.RxBillingGooglePlayLibraryV5(this);\n    // Use rxBilling to call your desired methods.\n  }\n\n  @Override public void onDestroy() {\n    super.onDestroy();\n    rxBilling.destroy();\n  }\n}\n```\n\n### Testing\n\nThere's also a dedicated testing artifact, which provides a [MockRxBilling](./rxbilling-testing/src/main/kotlin/com/vanniktech/rxbilling/testing/MockRxBilling.kt) class.\n\n```groovy\nimplementation 'com.vanniktech:rxbilling-testing:0.10.0'\n```\n\n# License\n\nCopyright (C) 2018 Vanniktech - Niklas Baudy\n\nLicensed under the Apache License, Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanniktech%2Frxbilling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanniktech%2Frxbilling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanniktech%2Frxbilling/lists"}