android-inapp-billing-v3 icon indicating copy to clipboard operation
android-inapp-billing-v3 copied to clipboard

Can we work to get this to really support v3?

Open RajatVaghani opened this issue 3 years ago • 31 comments

What will it take for us to get this done?

RajatVaghani avatar Jun 18 '21 08:06 RajatVaghani

As they said, Anjlab won't further support this library. I've made a library that uses google billing v4, you can check it out: https://github.com/moisoni97/google-inapp-billing

moisoni97 avatar Jun 18 '21 21:06 moisoni97

@moisoni97 I wonder if the library you made supports all the functions that exist in Anjlab.

RozeKurhy avatar Jun 26 '21 06:06 RozeKurhy

@RozeKurhy basically yes, if you're feeling that something is missing you can open a new issue or make a PR

moisoni97 avatar Jun 26 '21 22:06 moisoni97

I have upgraded the anjlab to the latest version 4 of google in-app billing. I hope the pull request is accepted soon.

showdpro avatar Jul 11 '21 18:07 showdpro

@anjlab Please Do accept, if you think that is right. Changing the library for Google Upgrade is so much pain.

Here is the google Declaration. Please solve this library for V3. Reminder: Starting on August 2, 2021, all new apps must use Billing Library version 3 or newer. By November 1, 2021, all updates to existing apps must use Billing Library version 3 or newer.

Mahmudul531 avatar Jul 14 '21 09:07 Mahmudul531

I have upgraded the anjlab to the latest version 4 of google in-app billing. I hope the pull request is accepted soon.

Consuming a purchase is not working. Always throws a failed to consume error.

creativetrendsapps avatar Jul 15 '21 03:07 creativetrendsapps

I have upgraded the anjlab to the latest version 4 of google in-app billing. I hope the pull request is accepted soon.

Consuming a purchase is not working. Always throws a failed to consume error.

@creativetrendsapps are you referring to the updated anjlab I did? if yes, does the others(subscription and onetime purchase) work. About the consume purchase please let us know which line this error was thrown, thanks.

showdpro avatar Jul 15 '21 12:07 showdpro

I have upgraded the anjlab to the latest version 4 of google in-app billing. I hope the pull request is accepted soon.

Consuming a purchase is not working. Always throws a failed to consume error.

@creativetrendsapps are you referring to the updated anjlab I did? if yes, does the others(subscription and onetime purchase) work. About the consume purchase please let us know which line this error was thrown, thanks.

Yes I used your pull request. Onetime purchases work (didn't check subscriptions).

I check if an item was purchased. I then try to consume the purchase. Logcat gives error : " E/iabv3: Failed to consume simplicity.lite.coffee: 5" My flow continues and then I get "You already own this item".

creativetrendsapps avatar Jul 15 '21 12:07 creativetrendsapps

I have upgraded the anjlab to the latest version 4 of google in-app billing. I hope the pull request is accepted soon.

Consuming a purchase is not working. Always throws a failed to consume error.

@creativetrendsapps are you referring to the updated anjlab I did? if yes, does the others(subscription and onetime purchase) work. About the consume purchase please let us know which line this error is thrown, thanks.

I have upgraded the anjlab to the latest version 4 of google in-app billing. I hope the pull request is accepted soon.

Consuming a purchase is not working. Always throws a failed to consume error.

@creativetrendsapps are you referring to the updated anjlab I did? if yes, does the others(subscription and onetime purchase) work. About the consume purchase please let us know which line this error was thrown, thanks.

Yes I used your pull request. Onetime purchases work (didn't check subscriptions).

I check if an item was purchased. I then try to consume the purchase. Logcat gives error : " E/iabv3: Failed to consume simplicity.lite.coffee: 5" My flow continues and then I get "You already own this item".

@creativetrendsapps ok, i understand, actually there are three method; purchase, subscribe and consumePurchase method. Please try to use the consumePurchase method for consumables. The error thrown is actually for a one time purchase error instead of consume method, because the

you already own this item

is one of the logs of purchase method not consume method.

showdpro avatar Jul 15 '21 12:07 showdpro

@creativetrendsapps ok, i understand, actually there are three method; purchase, subscribe and consumePurchase method. Please try to use the consumePurchase method for consumables. The error thrown is actually for a one time purchase error instead of consume method, because the

you already own this item

is one of the logs of purchase method not consume method.

This is the error when trying to consume the purchase

" E/iabv3: Failed to consume simplicity.lite.coffee: 5

creativetrendsapps avatar Jul 15 '21 12:07 creativetrendsapps

Ok, I will check it when I get home.

showdpro avatar Jul 15 '21 12:07 showdpro

.

@creativetrendsapps ok, i understand, actually there are three method; purchase, subscribe and consumePurchase method. Please try to use the consumePurchase method for consumables. The error thrown is actually for a one time purchase error instead of consume method, because the

you already own this item

is one of the logs of purchase method not consume method.

This is the error when trying to consume the purchase

" E/iabv3: Failed to consume simplicity.lite.coffee: 5

@creativetrendsapps Ok, I will check it when I get home

showdpro avatar Jul 15 '21 12:07 showdpro

.

@creativetrendsapps ok, i understand, actually there are three method; purchase, subscribe and consumePurchase method. Please try to use the consumePurchase method for consumables. The error thrown is actually for a one time purchase error instead of consume method, because the

you already own this item

is one of the logs of purchase method not consume method.

This is the error when trying to consume the purchase " E/iabv3: Failed to consume simplicity.lite.coffee: 5

@creativetrendsapps Ok, I will check it when I get home

@creativetrendsapps I have gone through the codes, I actually listed the consume as one of the todo, because i saw that it was already an issue before the update. I or anyone may pull a request once it is resolved. However, the purchase and the subscription are working fine.

showdpro avatar Jul 17 '21 07:07 showdpro

@creativetrendsapps I have gone through the codes, I actually listed the consume as one of the todo, because i saw that it was already an issue before the update. I or anyone may pull a request once it is resolved. However, the purchase and the subscription are working fine.

I just went ahead with this library which has consumables working perfect.

creativetrendsapps avatar Jul 17 '21 07:07 creativetrendsapps

@showdpro is your PR merged? I cant understand

tushar09 avatar Aug 06 '21 17:08 tushar09

@showdpro is your PR merged? I cant understand

@tushar09 not yet, Maybe @serggl is busy.

showdpro avatar Aug 07 '21 21:08 showdpro

@showdpro the ball is at your end currently. There are things mentioned in PR review that need to be handled.

serggl avatar Aug 08 '21 05:08 serggl

Still uncomfortable with google warnings when uploading applications to the playstore. still detected old version

deirputraid avatar Aug 09 '21 10:08 deirputraid

Still uncomfortable with google warnings when uploading applications to the playstore. still detected old version

I recommend that you read the above comments and PR. @showdpro has already improved with BL4 and added PR. Please wait a little longer.

RozeKurhy avatar Aug 11 '21 02:08 RozeKurhy

@showdpro the ball is at your end currently. There are things mentioned in PR review that need to be handled.

@serggl I have handled those things you mentioned in the PR review you did. Please kindly check through them again. Incase you need me to handle them differently, let me know by commenting on the specific line or code. Thanks.

showdpro avatar Aug 20 '21 15:08 showdpro

@showdpro I left more comments on the PR. Hope they make sense

serggl avatar Aug 23 '21 12:08 serggl

@showdpro in your IAB v4 repo under getting started there is this code bp.connect(this); //Connection required based on google Version 4 for inapp lib

but I'm facing the issue "Cannot resolve method 'connect' in BillingProcessor

wicaodian avatar Aug 31 '21 10:08 wicaodian

A weird thing happened. Writing in this issue because this issue is is on top right now.

I have implemented everything from @showdpro's repo and did everything in getting started and uploaded apk, and got the same error, old IAB version.

then after banging my head here and there for a while and I added this in my Gradle and uploaded the new apk again and issue went away.

implementation 'com.android.billingclient:billing:4.0.0' is it something new or this is how it was supposed to be done in first place?

wicaodian avatar Aug 31 '21 10:08 wicaodian

A weird thing happened. Writing in this issue because this issue is is on top right now.

I have implemented everything from @showdpro's repo and did everything in getting started and uploaded apk, and got the same error, old IAB version.

then after banging my head here and there for a while and I added this in my Gradle and uploaded the new apk again and issue went away.

implementation 'com.android.billingclient:billing:4.0.0' is it something new or this is how it was supposed to be done in first place?

Do you have server side receipt validation? If you do that also needs to be updated to the v3 endpoint

lilmnm-kamikaze- avatar Aug 31 '21 23:08 lilmnm-kamikaze-

@lilmnm-kamikaze- Nope, no server validation

wicaodian avatar Sep 01 '21 04:09 wicaodian

A weird thing happened. Writing in this issue because this issue is is on top right now. I have implemented everything from @showdpro's repo and did everything in getting started and uploaded apk, and got the same error, old IAB version. then after banging my head here and there for a while and I added this in my Gradle and uploaded the new apk again and issue went away. implementation 'com.android.billingclient:billing:4.0.0' is it something new or this is how it was supposed to be done in first place?

Do you have server side receipt validation? If you do that also needs to be updated to the v3 endpoint

@lilmnm-kamikaze- You can validate the user purchases from the json data you obtained in the onActivity after purchase. This json data contains the purchase information of the item purchased you can save and validate with this info server-side. On the other hand, the new Google library get the cache (in Playstore) for all purchases by the user, this can even be obtained offline from the Playstore app cache. I think with this we might not be needing the cache from the current anjlab library (i.e the BillingBase.java and the BillingCache.java) because this is already handled by Google themselves. But to be on a safer side, server-side validation is the best way to handle this.

showdpro avatar Sep 07 '21 00:09 showdpro

A weird thing happened. Writing in this issue because this issue is is on top right now. I have implemented everything from @showdpro's repo and did everything in getting started and uploaded apk, and got the same error, old IAB version. then after banging my head here and there for a while and I added this in my Gradle and uploaded the new apk again and issue went away. implementation 'com.android.billingclient:billing:4.0.0' is it something new or this is how it was supposed to be done in first place?

@wicaodian Actually you needed to add the implementation in your project. Until the library is merged, that is how you will implement it. I'm glad it worked eventually.

showdpro avatar Sep 07 '21 12:09 showdpro

Is the pull ready to be merged??

RajatVaghani avatar Oct 04 '21 19:10 RajatVaghani

up please 👍 @serggl

alexandreleick avatar Oct 12 '21 22:10 alexandreleick

I've implemented everything from the @showdpro library and it's working but I've noticed that my app stop working when this line is executed previousPurchases = bp.getPurchaseHistory(Constants.PRODUCT_TYPE_SUBSCRIPTION, new Bundle()); with this error in logcat (attached below) am I doing something wrong ?

Error in loadPurchasesByType org.json.JSONException: Value Purchase. of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:112) at org.json.JSONObject.(JSONObject.java:169) at org.json.JSONObject.(JSONObject.java:182) at com.anjlab.android.iab.v3.BillingProcessor.loadPurchasesByType(BillingProcessor.java:390) at com.anjlab.android.iab.v3.BillingProcessor.loadOwnedPurchasesFromGoogle(BillingProcessor.java:416) at com.blabla.MainActivity$WebAppInterface.login_already(MainActivity.java:184) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:206) at android.os.HandlerThread.run(HandlerThread.java:67)

nebojsa-jevtic avatar Oct 19 '21 09:10 nebojsa-jevtic