是否有必要从“Google Play Billing with AIDL”迁移到“Google Play Billing Library”?

Nis*_*han 6 in-app-purchase in-app-billing android-billing in-app-subscription android-inapp-purchase

我知道“Google Play Billing with AIDL”已弃用,但我正在使用的应用程序非常复杂,我不想更改应用程序的核心部分。

在游戏控制台上,我收到以下消息:-

“我们检测到您的应用使用的是旧版 Google Play Developer API。从 2019 年 12 月 1 日起,此 API 的版本 1 和 2 将不再可用。请在此日期之前更新到版本 3。”

我检查了“Google Play Billing Library”内部也使用相同的“Google Play Billing with AIDL”,所以我有点困惑,如果问题只能在更新库后才能解决。

在我的代码中,我已经在使用计费 API 的 API 版本 3。

private IInAppBillingService billingService;

Bundle buyIntentBundle = billingService.getBuyIntent(3, packageName, sku, type, developerPayload);
billingService.getSkuDetails(3, application.getPackageName(),
                                    ITEM_TYPE_INAPP, bundle);
billingService.consumePurchase(3, application.getPackageName(), iabOrder.purchaseToken);
billingService.getPurchases(3, application.getPackageName(), ITEM_TYPE_INAPP, null);
billingService.isBillingSupported(3, application.getPackageName(),
                    ITEM_TYPE_INAPP);
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我找出为什么我收到这条使用第三版 Google Play Developer API 的特殊消息的主要原因。

Nis*_*han 0

我收到此消息是因为在后端我们使用的库使用“Google Play Developer API v2”来验证购买。

我们曾经的图书馆

  • 库名称:应用内购买
  • 库版本:~1.8.2

详细信息可以在这里查看

因此,一旦我们将库更新到 1.10.0 以上的任何版本并按照步骤获取新库googleAccTokengoogleRefToken在代码中使用,这条消息就会被删除。