【问题标题】:Is it necessary to migrate from "Google Play Billing with AIDL" to "Google Play Billing Library"?是否有必要从“Google Play Billing with AIDL”迁移到“Google Play Billing Library”?
【发布时间】:2019-12-01 08:05:02
【问题描述】:

我知道“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 版本 3 的计费 API。

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);

谁能帮我找出为什么我收到使用 Google Play Developer API 第 3 版的特定消息的主要原因。

【问题讨论】:

    标签: in-app-purchase in-app-billing android-billing in-app-subscription android-inapp-purchase


    【解决方案1】:

    Google Play 结算库是您的 Android 应用中使用的客户端 API。

    Google Play Developer API 是用于管理购买和管理您在 Google Play 上的应用的服务器 API。

    “我们检测到您的应用正在使用旧版本的 Google Play Developer API。从 2019 年 12 月 1 日起,此 API 的第 1 版和第 2 版将不再可用。请在此日期之前更新到第 3 版。 "提示您更新您的 Google Play Developer API,而不是您的 Android 应用中使用的 Google Play 结算库。

    https://github.com/android/play-billing-samples/commit/36459a4d015b40f8c6840f202fb1127c6ec95947 是将 Google Play Developer API 更新到 v3 的示例

    【讨论】:

      【解决方案2】:

      我收到这条消息是因为我们在后端使用了一个库,该库使用“Google Play Developer API v2”来验证购买。

      我们曾经的图书馆

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

      详情可以通过here查看

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

      【讨论】:

      • 此答案不正确“我们检测到您的应用正在使用旧版本的 Google Play Developer API。从 2019 年 12 月 1 日起,此 API 的版本 1 和 2 将不再可用. 在此日期之前更新到第 3 版。”是关于 Google Play Developer API 的消息,它不同于 Google Play 结算库。
      【解决方案3】:

      我们有一条红色的警告消息通知所有开发者AIDL is deprecated 并将很快被删除。请升级到Google Play Billing Library并关注this sample

      【讨论】:

      • 在迁移计费 api 时,是否需要从包 com.android.vending.billing 导入 InAppBillingService?
      猜你喜欢
      • 2021-11-04
      • 1970-01-01
      • 1970-01-01
      • 2022-08-22
      • 1970-01-01
      • 2020-10-11
      • 1970-01-01
      • 1970-01-01
      • 2022-08-23
      相关资源
      最近更新 更多