Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated api #411

Merged
merged 4 commits into from
Jul 15, 2019
Merged

Update deprecated api #411

merged 4 commits into from
Jul 15, 2019

Conversation

rareboe
Copy link
Contributor

@rareboe rareboe commented Jul 3, 2019

  • remove IInAppBillingService.aidl file and added Google Play Billing Library.
  • update deprecated API

- remove Warning:Configuration 'compile' replaced with 'implementation'
- update targetSdkVersion 26 (Google Play requires that apps target API level 26 or higher)
- remove IInAppBillingService.aidl file and Use the Google Play Billing Library
- update deprecated API
@@ -782,11 +782,11 @@ public boolean consumePurchase(String productId)
try
{
TransactionDetails transaction = getPurchaseTransactionDetails(productId, cachedProducts);
if (transaction != null && !TextUtils.isEmpty(transaction.purchaseToken))
if (transaction != null && !TextUtils.isEmpty(transaction.purchaseInfo.purchaseData.purchaseToken))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this change? can you elaborate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TransactionDetails.purchaseToken field has been deprecated. so used purchaseInfo.purchaseData.purchaseToken field.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet behaviour will depend on the google play services version installed on a device.
I would do this in a non-breaking manner, checking for both old and new values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function use TransactionDetails instance.
TransactionDetails class constructor.
public TransactionDetails(PurchaseInfo info)
{
purchaseInfo = info;
productId = purchaseInfo.purchaseData.productId;
orderId = purchaseInfo.purchaseData.orderId;
purchaseToken = purchaseInfo.purchaseData.purchaseToken;
purchaseTime = purchaseInfo.purchaseData.purchaseTime;
}

so used purchaseInfo.purchaseData.purchaseToken field.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serggl Can we Merge ?

@serggl serggl merged commit 450b46d into anjlab:master Jul 15, 2019
@mustii82
Copy link

What about a new Release?

@serggl
Copy link
Member

serggl commented Jul 16, 2019

done ✅

@DennyWeinberg
Copy link

DennyWeinberg commented Jul 16, 2019

Thanks! Anything to pay attention to? Just update to 45? I read something about "Acknowledge purchases" that needs to be done in v3?
@mustii82

@rareboe
Copy link
Contributor Author

rareboe commented Jul 18, 2019

@DennyWeinberg This issue solves the problem in the screenshot.
image

#406 This issue maybe not application issue. Because this library is using version 3 or higher.
Declaration : Constants.GOOGLE_API_VERSION
Use code : BillingProcessor

I manage a lot of projects, and those warnings were mostly APIs that the server calls.
Check version 'googleapis.com/androidpublisher/{version}/applications' from caller.

@DennyWeinberg
Copy link

@jin-conbus, thanks! So I think we all are not talking about the same topic, after checking #406 and #160. I'm not sure if you could leave a comment in the open issues to clarify and to make understand everybody whats going on...?
If I understand right, this library already uses v3, so we are fine for end of 2019 and we don't need to worry. The merged pull request was about another topic.

Thanks again!

@stereomatch
Copy link

stereomatch commented Jul 18, 2019

@DennyWeinberg @jin-conbus @mustii82

DennyWeinberg is referring to this issue discussed on r/androiddev in his comment above:

Thanks! Anything to pay attention to? Just update to 45? I read something about "Acknowledge purchases" that needs to be done in v3?

The question is, if anjlab is now using Google Play Billing Library version 2.0 (in x.45 ?), then will we need to change our code to acknowledge purchases explicitly.

Or is anjlab doing that somewhere already - if not, the usage guidelines should be updated, so a user can change their code that uses anjlab accordingly.

References:

https://www.reddit.com/r/androiddev/comments/bmvvey/in_app_billing_aidl_deprecated/
In App Billing AIDL deprecated
Tolriq

https://www.reddit.com/r/androiddev/comments/bsgfx6/play_store_automatic_refunds_after_72_hours/
Posted byu/Andriensis
Play Store automatic refunds after 72 hours?

https://developer.android.com/google/play/billing/billing_library_releases_notes

Google Play Billing Library 2.0 Release (2019-05-07)
Version 2.0 of the Google Play Billing library is now available. This version contains the following changes.
Purchases must be acknowledged within three days

Pending transactions
With version 2.0 of the Google Play Billing library, you must support purchases where additional action is required before granting entitlement.

@stereomatch
Copy link

@DennyWeinberg @jin-conbus @mustii82

Also just to be clear about versions, and under what conditions the AIDL error was appearing for some developers:

  • Google Play Billing library is version 2.0.x (latest)

  • anjlab v3 1.0.45 now uses Google Play Billing library version 2.0.x, and does not use the AIDL way of doing things (this therefore avoids the error message some were getting about the use of AIDL)

I was not getting any error about use of AIDL when using:
anjlab-iabv3-1.0.44.jar

but the app was targeting API 27 - perhaps the AIDL error starts appearing when you target API 28 ?

Or it appears if some developers were using some specific API call in anjlab ?

@rareboe
Copy link
Contributor Author

rareboe commented Jul 19, 2019

@stereomatch
What you're talking about is likely to be talking about using 'BillingClient'.
However, we are currently using IInAppBillingService.
We can use it as it is.

use 'com.android.billingclient:billing:2.0.1' only bottom reason
AIDL is now deprecated and will be removed in a future release.

But we can still use the old method.
Because include 'IInAppBillingService' and can use interface.

image

@stereomatch
Copy link

stereomatch commented Jul 19, 2019

@jin-conbus

So if I understand it correctly, we have 3 different versions that maybe relevant to anjlab ?

  • anjlab 1.0.44 and 1.0.45 (recently updated)

  • Google Play Billing library 1.2.2 and 2.0 - are both anjlab 1.0.44 and 1.0.45 using 1.2.2 (using AIDL method, and not switched to 2.0 yet ?)

  • Google Play Developer API v2 and v3 - I don't know why this is relevant to anjlab, but maybe anjlab uses some APIs from this library

 

The Google Play Developer API v2/v3 issue seems to be related to these threads:

#402
Changes to the Google Play Developer API #402

https://github.com/idehub/react-native-billing/issues/160
Update to Google Play Developer API v3 (v2 end of life Dec 2019) #160

 

The Google Play Billing library 1.2.2 is being used by both anjlab 1.0.44 and 1.0.45 ? That is, both use the AIDL method ?

https://developer.android.com/google/play/billing/billing_library_releases_notes
Google Play Billing Library

Google Play Billing Library 2.0 Release (2019-05-07)

Google Play Billing Library 1.2.2 Release (2019-03-07)

I ask because your first comment above seems to suggest otherwise:

remove IInAppBillingService.aidl file and Use the Google Play Billing Library
update deprecated API

 

You also said:

What you're talking about is likely to be talking about using 'BillingClient'.
However, we are currently using IInAppBillingService.
We can use it as it is.

use 'com.android.billingclient:billing:2.0.1' only bottom reason
AIDL is now deprecated and will be removed in a future release.

But we can still use the old method.
Because include 'IInAppBillingService' and can use interface.

So "IInAppBillingService" is only used when you are using the AIDL method (and Google Play Billing library 1.2.2) - correct ?

Will anjlab be updated to stop using the AIDL method (and "IInAppBillingService"), and switch to Google Play Billing library 2.0 (which doesn't use AIDL) ?

@rareboe
Copy link
Contributor Author

rareboe commented Jul 19, 2019

@stereomatch

So if I understand it correctly, we have 3 different versions that maybe relevant to anjlab ? :

  • Before anjlab 1.0.45, And anjlab 1.0.45 also uses AIDL interface.

The Google Play Developer API v2/v3 issue seems to be related to these threads :

  • As I mentioned above, those warnings were mostly APIs that the server calls.
    Check version 'googleapis.com/androidpublisher/{version}/applications' from caller.

The Google Play Billing library 1.2.2 is being used by both anjlab 1.0.44 and 1.0.45 ? That is, both use the AIDL method ? :

  • anjlab library use AIDL method.

I ask because your first comment above seems to suggest otherwise :

  • I understood why you asked.(Corrected this comment.) IinappBillingService.aidl is removed to use the latest AIDL method and the AIDL method provided by the Google Play Billing Library is used. (The update deprecated API refers to the portion deprecated in anjlab as mentioned above.)

So "IInAppBillingService" is only used when you are using the AIDL method (and Google Play Billing library 1.2.2) - correct ? :

  • Yes

Will anjlab be updated to stop using the AIDL method (and "IInAppBillingService"), and switch to Google Play Billing library 2.0 (which doesn't use AIDL) ? :

  • Perhaps it will.

@stereomatch
Copy link

Thanks.

So clarifying further:

  • anjlab 1.0.44, and even 1.0.45 (which fixes the error with "IinappBillingService"), STILL uses the AIDL method, but a newer variant of it, which avoids the "IinappBillingService" error.

  • anjlab 1.0.44, and even 1.0.45 stil uses Google Play Billing library 1.2.x (and not 2.0 yet)

  • a future version of anjlab may start to support Google Play Billing library 2.0 - at which point anjlab will stop using the AIDL method

  • the "Google Play Developer API v2/v3 issue" is a separate issue, unrelated to the eventual transition to Google Play Billing library 1.2.x (AIDL) to 2.0

@xDragonZ
Copy link

So this PR is still using aidl and purchase no need to be acknowledged yet?

@stereomatch
Copy link

So this PR is still using aidl and purchase no need to be acknowledged yet?

@xDragonZ that is my impression.

showdpro pushed a commit to showdpro/android-inapp-billing-v3 that referenced this pull request Jul 13, 2021
* - update gradle version 3.1.0
- remove Warning:Configuration 'compile' replaced with 'implementation'
- update targetSdkVersion 26 (Google Play requires that apps target API level 26 or higher)
- remove IInAppBillingService.aidl file and Use the Google Play Billing Library
- update deprecated API

* sample project use annotations version 26.0.1

* revert compileSdkVersion and buildToolsVersion

* revert gradle version
showdpro pushed a commit to showdpro/android-inapp-billing-v3 that referenced this pull request Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants