anjlab / android-inapp-billing-v3

A lightweight implementation of Android In-app Billing Version 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we work to get this to really support v3?

RajatVaghani opened this issue · comments

What will it take for us to get this done?

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 I wonder if the library you made supports all the functions that exist in Anjlab.

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

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

@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.

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.

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.

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".

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.

@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

Ok, I will check it when I get home.

.

@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 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.

@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.

@showdpro is your PR merged? I cant understand

@showdpro is your PR merged? I cant understand

@tushar09 not yet, Maybe @serggl is busy.

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

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

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.

@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 I left more comments on the PR. Hope they make sense

@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

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?

commented

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- Nope, no server validation

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.

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.

Is the pull ready to be merged??

up please 👍 @serggl

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)

Library was upgraded. See #497