AlexDisler / cordova-plugin-inapppurchase

A lightweight cordova plugin for in app purchases on iOS/Android
315 stars 192 forks source link

Is this plugin uses Google Play Developer API Version 3 for In-App-Purchase and Subscriptions? #269

Open rushabhmakwana-multidots opened 5 years ago

rushabhmakwana-multidots commented 5 years ago

@AlexDisler I am developing an IONIC application in which I am implementing the functionality of in-app-purchase. As we know, At Google I/O '18, Google introduced version 3 of the API and from December 1, 2019, versions 1 and 2 of the Google Play Developer API will be shut down or no longer be available as per Google guidelines(https://android-developers.googleblog.com/2019/03/changes-to-google-play-developer-api.html). So is this plugin already provide support for Google Play Developer API Version 3 or do we need to add support for making plugin compatible with Google Play Developer API Version 3 for In-App-Purchase and Subscriptions?

Please help!

streemy commented 5 years ago

According to line 22 of src/android/billing/IInAppBillingService.aidl file:

InAppBillingService is the service that provides in-app billing version 3 and beyond.

But I'm not sure, that in-app-billing and Google Play Developer API are the same things. P.S. Also, latest update in src/android/billing/IInAppBillingService.aidl file was 3 years ago, but:

As we know, At Google I/O '18, Google introduced version 3 of the API

@AlexDisler, could you please answer this question.

AlexeyYar commented 4 years ago

@AlexDisler, hello! Could you please, clarify will the plugin compatible with the Google Play API v.3?

ragcsalo commented 4 years ago

Is there a working version of this plugin that still can be used with up-to-date Android projects? I can't get a list of my products, can't restore purchases... and even get an error message during the purchase even though it's successfull..... Does this even work with closed Beta releases, or I have to go public to test it?

wccrawford commented 4 years ago

Our apps using this plugin are getting a warning that we're not using v3 of the API.

thesayyn commented 4 years ago

Alex won't be able to maintain this repo so I had to maintain my version of it.

https://github.com/thesayyn/cordova-plugin-inapppurchase

Supports introductory price and I've fixed some issues.

wccrawford commented 4 years ago

I spent some time looking through the code for this plugin, and so far as I can tell it uses v3. I'm unable to find any other code that uses this API in our project, and now we're uncertain why we got this warning from Google.

Chadori commented 4 years ago

@thesayyn do you have an npm buid? Thanks.

thesayyn commented 4 years ago

@ChadoriRebornXD nope you can use it directly from my repo

gasci commented 4 years ago

What is the current situation? We are receiving the same warning on developer console. Do we have to find another plugin to handle inapppurchases before December 1st or is this plugin compatible with v3?

wccrawford commented 4 years ago

For our project, we found some server side coffee that was using v2 of that API and we believe the warnings have stopped for us. I no longer think this plugging had anything to do with the warnings.

caleb87 commented 4 years ago

Thanks for the tip crawford. I noticed some server side stuff was using v2 and all I had to do is change to URL to v3 (nothing changed for my purposes).

https://www.googleapis.com/androidpublisher/v2/applications/.....
https://www.googleapis.com/androidpublisher/v3/applications/.....

I opened the APK up and looked at the in-app purchase code and it shows :

cordova.define("cordova-plugin-inapppurchase.InAppBillingV3", function(require, exports, module) {

I wonder if this means the APK is using the v3 within the app itself?

wccrawford commented 4 years ago

It's a been a bit, but IIRC I followed the logic to the end and found it was calling functions with 3 as the first parameter, and it said it was the version of the service.

Looking again, I see that the documentation for the functions being used (like isBillingSupported) say it is deprecated now and to use a completely different library.

https://android-developers.googleblog.com/2019/06/advanced-in-app-billing-handling.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FhsDu+%28Android+Developers+Blog%29 recommends that we migrate to the new library asap, and I found a reddit comment referencing a video saying (6 months ago) that it would be removed in 2 years.

caleb87 commented 4 years ago

After going through it, I believe it's dependent upon which .aidl file was used from Android Studio.

I remember having an issue with this file the last time I uploaded a production APK, and it was likely the file was v2 and the store wouldn't let me use it.

Anyway, inside the IInAppBillingService.aidl file it says:

 * InAppBillingService is the service that provides in-app billing version 3 and beyond.
 * This service provides the following features:
 * 1. Provides a new API to get details of in-app items published for the app including
 *    price, type, title and description.
 * 2. The purchase flow is synchronous and purchase information is available immediately
 *    after it completes.
 * 3. Purchase information of in-app purchases is maintained within the Google Play system
 *    till the purchase is consumed.
 * 4. An API to consume a purchase of an inapp item. All purchases of one-time
 *    in-app items are consumable and thereafter can be purchased again.
 * 5. An API to get current purchases of the user immediately. This will not contain any
 *    consumed purchases.
 ....
interface IInAppBillingService {
    /**
     * Checks support for the requested billing API version, package and in-app type.
     * Minimum API version supported by this interface is 3.

Seems clear to me that my app with this plugin is using v3. You can always download your production APK, unzip it, and then search that file and it should be there.

I think you're right that the server side API calls were creating the warning message. The app surely would have broke without fixing those too.

Sadly I'm not aware of anyway to confirm that the app is now in good working order :(

Thanks for your help William! Made my day easier :)

chuchuva commented 4 years ago

I believe cordova-plugin-inapppurchase is not affected by Google Play Developer API v1 and v2 deprecation:

For in-app billing developers This deprecation only affects the APIs which are used to interact with Play Billing via server to server communication. Android apps that use the AIDL / Billing Library to provide in-app purchase functionality are unaffected.

(from https://android-developers.googleblog.com/2019/03/changes-to-google-play-developer-api.html )

You get this warning in Google Play Console if you are doing server-to-server calls to Google Play Developer API v1 or v2:

We've detected that your app is using an old version of the Google Play Developer API. From December 1 2019, versions 1 and 2 of this API will no longer be available. Update to version 3 before this date. Note that this is not related to the AIDL/Billing Library deprecation.

ninexus commented 4 years ago

is there any way we can test inapp-purchase using cordova plugin before 1st December,2019. To be sure if it's going to work on after 1st, secondly we need an alternate, in case plugin gets collapsed.

SophiaBelkin commented 3 years ago

Thanks @chuchuva https://android-developers.googleblog.com/2020/06/meet-google-play-billing-library.html

Just like Play’s TargetSDK requirements, it’s important that all users are able to benefit from any security, performance, and user experience improvements in new versions of Billing Library. At Google I/O in 2019, we released Billing Library version 2 and announced changes including a two-year support window for each major release.

This means starting 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.