android-billing

Android In App Billing: Can't start launchPurchaseFlow because launchPurchaseFlow is in progress

大城市里の小女人 提交于 2019-12-17 22:57:10
问题 I'm implementing In App Billing for the first time and I'm testing my first purchases using the static SKU ids. It worked very well the first time. I called mHelper.launchPurchaseFlow(...) and completed the test purchase. My activity received the onActivityResult callback and I made sure to process it with mHelper.handleActivityResult(...) . Everything was great. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // Pass on the activity result to the

Android in-app billing: Can't start async operation because another async operation (is in progress)

半腔热情 提交于 2019-12-17 17:25:53
问题 I am using the IabHelper utility classes, as recommended by Google's tutorial, and I'm being hit hard by this error. Apparently IabHelper can not run multiple async operations at the same time. I even managed to hit it by trying to start a purchase while the inventory taking was still in progress. I have already tried to implement onActivityResult in my main class as suggested here, but I don't even get a call to that method before the error hits. Then I found this but I have no idea where to

What is the response for RESTORE_TRANSACTIONS in case of subscription bought twice?

最后都变了- 提交于 2019-12-12 05:40:04
问题 I can't test this myself, because there is no way to completely terminate subscription, apparently. So, I want to test the following use case: user buys subscription, cancel's it (or it expires), than user buys same subscription. What will I get with RESTORE_TRANSACTIONS response? Will I get two items with same item id, different purchase tokens and different state? Or purchaseToken will remain the same? I'm afraid that there will be only one subscription with different order ID and purchase

In-app billing verification. Does server side code example exist somewhere?

戏子无情 提交于 2019-12-12 03:43:16
问题 A lot of people ask how to write server side code for in-app billing verificartion. Can anybody publish such code? Or know where such code is. How to install in on the server? There are similar subjects I could not understand it. I don't know php. Is it the next nightmare which I must study? Thanks for help and advices. 回答1: Actually it's pretty easy, you just need a small function like this in PHP: function checkPayment($data, $signature) { $base64EncodedPublicKey = "yourBase64PublicKey";

Android billing - item not found

一笑奈何 提交于 2019-12-11 19:19:52
问题 I created a subscription product and when people try to buy it, they click from my app to the app store, and they get an error "item not found" But the items shows up as live in my developer console. Here is how I call it: Here is the onActivityResult() from this method: protected void onActivityResult(int requestCode, int resultCode, Intent data) { sendEmail(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data results in this: onActivityResult(10001,0,Intent { (has extras)

In-App billing get if the user purchased the app before it was free

人盡茶涼 提交于 2019-12-11 19:19:30
问题 I want to be able to get the state of the user purchases but on the current app they are in from when it was paid to free. For example App SuperCars was paid app but the latest update makes it free with in-app purchases. I want previous users who paid for the app to have access to paid content but new users to have no access in which they would need to pay. Can anyone give me an example of how I would do this? How do I get the user paid sate?? 回答1: After looking around and contacting certain

ANR com.android.vending.billing.IInAppBillingService

这一生的挚爱 提交于 2019-12-07 12:12:42
问题 Ever since modifying my code to use the Android billing library instead of the old IABHelper from the sample app, I have been getting a lot of ANRs with this trace below. Anyone have any idea how to solve that? there isn't a single line of my code on the trace. "main" prio=5 tid=1 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x73b53ac0 self=0x77558a3a00 | sysTid=17097 nice=0 cgrp=default sched=0/0 handle=0x775a8109b0 | state=S schedstat=( 21526708836 9207381756 40660 ) utm=1497 stm

How to properly update Android BillingFlowParams methods deprecated

 ̄綄美尐妖づ 提交于 2019-12-06 04:28:17
问题 I have BillingFlowParams purchaseParams = BillingFlowParams.newBuilder().setSku(skuId).setType(billingType).setOldSkus(oldSkus).build(); but now setSku setType setOldSkus are all deprecated. I want to update the old code without releasing an update that mess with the active and future subscriptions. How should I properly update the above code? Currently I use a String myProduct="my_newsweek_1"; to identify the purchase and BillingClient.SkuType.SUBS to identify the type, and I simply pass

BillingClient always returns SERVICE_DISCONNECTED

邮差的信 提交于 2019-12-05 08:38:23
So I have a billing client which I instantiate with billingClient = BillingClient.newBuilder(this).setListener(this).build(); I then call billingClient.startConnection(new BillingClientStateListener() { @Override public void onBillingSetupFinished(int responseCode) { //TODO: use this for stuff com.android.billingclient.api.Purchase.PurchasesResult result; result = billingClient.queryPurchases(BillingClient.SkuType.SUBS); Timber.d(result.toString()); } @Override public void onBillingServiceDisconnected() { //TODO: use this for stuff Timber.d("something went wrong "); } }); for whatever reason

How to implement in-game currency with Google's In-app Billing Version 3

断了今生、忘了曾经 提交于 2019-12-05 02:35:24
问题 Like the title says, how should I implement a currency system with Google's latest in-app billing v3. The basics: I have currency. This currency is earned or purchased. Currency is given to players periodically. Currency can be purchased in lots (1,5,10,20,50,100) or atleast that is what I wanted. Google Play v3 forces you to store ownership details of consumable items on their servers. You can not purchase the same item over until it is consumed first, removed from ownership according to